1、新建php文件
2、声明要读取的文件
3、file_get_contents():读取文件内容
4、输出文件内容
5、文件内容预览效果如图
6、页面预览效果如图
7、如果不想要链接,strip_tags可以过滤掉
8、页面预览效果如图附上源码<?php//file_get_contents():读取文件内容$filename="./2.txt";$string=file_get_contents($filename);echo $string;echo "<br>";echo strip_tags($string);