Home > Backend Development > PHP Tutorial > 怎样用php显示源代码,该如何解决

怎样用php显示源代码,该如何解决

WBOY
Release: 2016-06-13 10:24:03
Original
2292 people have browsed it

怎样用php显示源代码
我想用php显示源代码,是放在txt中,可是用fgetc()或者fread()读取文件时,显示的都是txt中代码解析后的内容,我想直接显示源代码而非解析后的内容,各位有什么方法没?

------解决方案--------------------
实体化输出

echo htmlentities($phpCode);
------解决方案--------------------
不可能啊? fread读取本地文件都是纯文本,不带被php解析的啊
莫不成你是想看看别人服务器上php文件的源代码?
------解决方案--------------------
你的代码

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template