php set_include_path include 疑惑,该如何处理

WBOY
Release: 2016-06-13 13:50:22
Original
713 people have browsed it

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 就加载了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!