<?php
$a=file_get_contents("000.txt");
echo $a;
?><?php
$file_handle = fopen("000.txt", "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
echo $line;
}
?>
两段代码都能读取txtl类型文件 可是不能读*.php的 为什么?php类型文件如何读取并显示?
$a=file_get_contents("000.txt");
echo $a;
?><?php
$file_handle = fopen("000.txt", "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
echo $line;
}
?>
两段代码都能读取txtl类型文件 可是不能读*.php的 为什么?php类型文件如何读取并显示?
highlight_file('ad.php');下面的代码:
$content = file_get_contents('ad.php');echo $content;
的确是这样的,如果文件是可执行的file_get_contents获取的是执行后的数据
$content = file_get_contents('test.php');
file_put_contents('test.txt', $content);
生成的test.txt中的内容就是test.php中的内容,只要你不让php中的内容直接显示就行
执行了也该显示haha 怎么什么都没有
include('php.php');
require()
<?php
echo 'aa';
?><?php
include('php.php'); //结果 aa
?>