Home  >  Article  >  Backend Development  >  include+dirname有关问题

include+dirname有关问题

WBOY
WBOYOriginal
2016-06-13 13:16:16898browse

include+dirname问题
在A.php中有这么一句,include 'dirname(__FILE__)."/1.php"';本义是想把和A.PHP在同一路径下的1.php给包含进来,但在执行时,报错如下:
PHP Warning: include(dirname(__FILE__)."/lcsClass.php"): failed to open stream: No such file or directory in /home/ninglan.cc/test/test/MetaDataComp.php on line 4
我要怎么改呢?

------解决方案--------------------
include dirname(__FILE__)."/1.php";
------解决方案--------------------
加了就成字符串了 而不是函数

探讨

引用:

去掉两端的单引号

这里加了引号,为什么就错了呢
Statement:
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