file_get_contents未提取完整文件内容 [英] file_get_contents not extracting full file contents

查看:160
本文介绍了file_get_contents未提取完整文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php函数file_get_contents来解析php文件.但是似乎一旦读取php标签,file_get_contents就会出现故障.

I m using the php function file_get_contents to parse a php file. But it seems that as soon as it is reading the php tags the file_get_contents is malfunctioning.

我用一个正常的文本文件检查了该功能,其功能正常.但是,即使它在文本文件中找到了php标签,该文件也已被读取一半.我如何找到一种获取全部内容的方法.

I checked the function with a normal text file, its functioning perfectly. But even if it finds php tags in a text file, the file is being half read. How can i find a way to get the full contents.

推荐答案

文件在本地吗?还是您正在尝试获取远程文件?您如何检查未读内容?由于<?php

Is the file local? Or are you trying to get a remote file? How did you check that the content is not read? Echoing it to a browser might trick you because of the < char in <?php

使用htmlspecialchars<pre>查看整个文本.或者只是查看页面的来源.

Use htmlspecialchars or <pre> to view the whole text. Or just look at the source of the page.

这篇关于file_get_contents未提取完整文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆