abstract:echo file_get_contents('text.txt'); // 直接获取文件内容strip_tags 去除html标记echo strip_tags(file_get_contents('text.txt')); // 获取去除html标记的文件内容echo file_get_contents('http://www.baidu.com'
echo file_get_contents('text.txt'); // 直接获取文件内容
strip_tags 去除html标记
echo strip_tags(file_get_contents('text.txt')); // 获取去除html标记的文件内容
echo file_get_contents('http://www.baidu.com'); // 获取远程文件内容
echo file_get_contents('123.jpg'); // 获取图片 注意:获取图片显示时需要声明头部
echo file_get_contents('text3.csv'); // 获取csv格式文件内容
var_dump(file_put_contents('text4.txt','PHP中文网学PHP'));
$str = file_get_contents('text4.txt');
var_dump(file_put_contents('text4.txt',"$str.PHP中文网的老师都很好"));
Correcting teacher:韦小宝Correction time:2019-03-09 17:29:43
Teacher's summary:file_put_contents和file_get_contents这两个函数是以后使用到差不多最多的 一定要好好去掌握哦 file_get_contents不仅仅可以获取文件中的内容