您的位置:首页 > 编程语言 > PHP开发

php 文件路径设置 set_include_path(); get_include_path();

2014-02-10 20:59 696 查看
<?php
set_include_path($string); //设置路径

get_include_path(); // 获取当前的路径

//例如:文件路径为:
//D:/phpweb/demo/test.php
//test.php内容为:
echo "hi";

//D:/phpweb/index.php
//index.php内容为:

set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__)."/demo/");
require_once("test.php");

//用 PATH_SEPARATOR分格目录(window 为 ; linux 为 :)

// 这样就可以调用test.php文件里面的内容了
?>


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: