我正在尝试使用 include_once() php api 将文件 (myfile.php) 的内容加载到另一个 (index.php) 中。但它没有加载内容。
// contents inside index page
if(include_once('myfile.php')){
echo D; // this is working
echo $b; // this is not working
} else {
echo "unable to include the file";
}
// contents inside myfile.php
define('D', '123');
$b = "abcd";