惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
Vercel News
Vercel News
F
Fortinet All Blogs
B
Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
月光博客
月光博客

博客园 - Siko

Sql Server中的日期和时间函数 neebaa依然缺人 C#2.0相关 如何才能成为一名真正的Web程序员 zt ASP常用函数表 - Siko - 博客园 关于弹窗 - Siko - 博客园 真正的大牛(zz) win 2003 server的一些优化设置 快速关闭Win2003的三种方法 生成静态页大全[ASP/PHP/ASPX] 收集自落伍论坛 ASP学习:错误80004005信息处理方法 ASP之对象总结 ASP中各种数据库连接代码 Temporary ASP.NET Files 下的不能生成dll文件。。。。 关于.NET 访问Oracle数据库 SQL查询语句使用 The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experience SqlDataAdapter使用存储过程不能使用参数? IIS 错误代码大汇总
在html中显示PHP源文件的几种方法
Siko · 2006-05-19 · via 博客园 - Siko

目的是在html页面中显示PHP源代码,并且是彩色方式显示!

1。利用apache server的配置文件httpd.conf,添加一行:
AddType application/x-httpd-php-source .phps
然后,把php源文件存储为.phps结尾的文件名即可,这样在浏览器中点击*.phps文件,显示的即为php彩色源代码。

2。利用php的函数(php4版本以上)

----函数一:show_source(filename)
返回的就是文件filename的php源代码,如:
<?php
show_source("test.php");
?>

----函数二:highlight_string(string)
返回的就是把字串string中的php代码彩色显示,如:
<?php
highlight_string("<?php echo \\\\"hello!\\\\" ?>");
?>