<!DOCTYPE html>
<html>
<body>
<?php
echo "aaa";
echo readfile("webdirectory.txt");
?>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------------------------
提示:如果在 php.ini 文件中 "fopen wrappers" 已经被激活,则在本函数中可以把 URL 作为文件名来使用。
<!DOCTYPE html>
<html>
<body>
<?php
echo "aaa";
echo readfile("http://localhost/test2/webdirectory.txt");
?>
</body>
</html>
-------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<body>
<?php
echo "aaa\n";
//echo readfile("http://localhost/test2/webdirectory.txt");
//print readfile("http://localhost/test2/webdirectory.txt");
print file_get_contents("http://localhost/test2/webdirectory.txt");
?>
</body>
</html>
沒有留言:
張貼留言