日期:2014-05-17  浏览次数:20418 次

php set_include_path include 疑惑
1.假设在 include/目录里有config.php文件
2.如果用set_include_path('../include')后
3.想再index.php用config的东西只要include('config.php') 就可以了。

疑问:那我在其他页面只需include('config.php'),还是set_include_path('../include')在include('config.php')呢?
他不可以跨页面,或者跨目录吗?


------解决方案--------------------
还得加上:set_include_path('../include'); 前提是其他文件必须和你的index.php文件在同级目录。
------解决方案--------------------
没用过zendframework ,你试试不就知道了。。 可能可以呢。
------解决方案--------------------
探讨

哦好的 谢谢 那zendframework 里也是这样的吗? zf里好像index.php 中include之后 其他就不需要了 像这种写法 load::class 就加载了