开发者

Reading PHP code using file_get_contents

T开发者_如何学JAVAhe file_get_contents function doesn't seem to be able to read PHP code from .php files. It seems to ignore everything after a <?php tag.

Why might be that?


I guess it isn’t file_get_contents but the way you print the content. Use htmlspecialchars to have the content encoded properly when putting it out into an HTML document:

echo '<pre>', htmlspecialchars(file_get_contents('file')), '</pre>';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜