首页 > Web开发 > 详细

【PHP】解决 file_get_contents( ) 函数,读取".php"结尾文件,会注释部分代码

时间:2020-02-12 19:09:39      阅读:79      评论:0      收藏:0      [点我收藏+]

时间回顾:
/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;

技术分享图片

【PHP】解决 file_get_contents( ) 函数,读取".php"结尾文件,会注释部分代码

原文:https://www.cnblogs.com/richerdyoung/p/12300059.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!