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

推荐订阅源

N
News | PayPal Newsroom
U
Unit 42
MongoDB | Blog
MongoDB | Blog
IT之家
IT之家
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
P
Privacy & Cybersecurity Law Blog
V
V2EX
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Know Your Adversary
Know Your Adversary
L
LINUX DO - 热门话题
GbyAI
GbyAI
T
Threat Research - Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
腾讯CDC
WordPress大学
WordPress大学
K
Kaspersky official blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
M
MIT News - Artificial intelligence
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
TaoSecurity Blog
TaoSecurity Blog
Latest news
Latest news
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
NISL@THU
NISL@THU
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
PCI Perspectives
PCI Perspectives
T
Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
大猫的无限游戏
大猫的无限游戏
Help Net Security
Help Net Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
W
WeLiveSecurity
小众软件
小众软件
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
F
Full Disclosure

博客园 - 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!\\\\" ?>");
?>