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

推荐订阅源

GbyAI
GbyAI
Blog — PlanetScale
Blog — PlanetScale
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
L
LangChain Blog
F
Fortinet All Blogs
C
Check Point Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
J
Java Code Geeks
月光博客
月光博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
宝玉的分享
宝玉的分享
Jina AI
Jina AI

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