【PHP】解决 file_get_contents( ) 函数,读取".php"结尾文件,会注释部分代码
时间回顾:
/test.php
$file_path = './test.php';
$site_conf =file_get_contents($dbconfig_path);
echo '<pre>';
print_r($site_conf);exit;
解决办法
需要htmlentities( )将其作为实体输出;
$file_path = './test.php';
$site_conf = htmlentities( file_get_contents($dbconfig_path) );
echo '<pre>';
print_r($site_conf);exit;
欢迎做技术的朋友一起沟通交流!伸手党请绕道,
代码改变世界QQ群:453011886