读取:
1)file_get_contents()
使用file_get_contents()函数能在编译器编译后能显示出文件源代码,而在浏览器中打开时不能显示源代码。
代码使用如下:
<?php
echo fiel_get_contents('文件路径');
?>
2
)readfile()
使用readfile()函数能在编译器编译后能显示出文件源代码,而在浏览器中打开时不能显示源代码。
代码使用如下:
<?php
echo readfile('文件路径');
?>
3
)highlight_file()
使用highlight()函数能在编译器编译后能显示出文件源代码,并且在浏览器中打开时也能显示源代码。
代码使用如下:
<?php
echo highlight_file('文件路径');
?>