搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
服务端开发
PHP 教程
PHP 高级教程
源代码
清空
点击运行
<?php $file = "data.txt"; //检查文件是否存在 if(file_exists($file)){ // 将整个文件读入字符串 $content = file_get_contents($file) or die("ERROR: Cannot open the file."); //显示文件内容 echo $content; } else{ echo "ERROR: File does not exist."; } ?>
运行结果