1
A
回答
12
我想这不是file_get_contents
,而是您打印内容的方式。使用htmlspecialchars
在将内容放入HTML文档时,可以正确编码内容:
echo '<pre>', htmlspecialchars(file_get_contents('file')), '</pre>';
相关问题
- 1. file_get_contents和php代码
- 2. PHP file_get_contents源代码位置
- 3. 重复PHP读取代码
- 4. 使用file_get_contents(PHP)
- 5. php file_get_contents无法读取xml服务
- 6. 在PHP中使用file_get_contents读取一个CSV
- 7. PHP的file_get_contents不能得到HTML代码
- 8. 不可能使用file_get_html /的file_get_contents PHP代码如何解决
- 9. 使用PHP file_get_contents获取IP地址
- 10. 用PHP阅读源代码
- 11. PHP代码读取JSON文件
- 12. 使用java代码读取xml节点
- 13. 使用读取宏编译Lisp代码
- 14. PHP - 使用file_get_contents问题
- 15. 使用PHP函数file_get_contents
- 16. PHP file_get_contents使用变量
- 17. OpenUI5代码读取
- 18. 可以用cURL从PHP文件中读取PHP代码吗?
- 19. 在ubuntu上使用代码块读取arduino的串行代码
- 20. 使用Java代码从SAP读取IDOC代码
- 21. 我如何使php源代码(c代码)从php.ini中读取数组?
- 22. php curl - 只读html代码
- 23. PHP file_get_contents
- 24. file_get_contents()PHP
- 25. PHP代码读取网页的源代码并从标签获取属性
- 26. file_get_contents需要php的内容!我需要在HTML代码中的源代码
- 27. 图片不显示使用读取文件/ file_get_contents
- 28. 从php://输入使用CURL和不使用file_get_contents获取/读取原始发布数据
- 29. PHP preg_match_all获取PHP代码
- 30. 如何用php代码读取csv文件?
您得到的错误是什么?一些代码 – 2010-08-26 14:47:06
没有错误。只是返回的值似乎是空的。 – 2010-08-26 14:50:38