亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

讀取文件內(nèi)容實(shí)例

原創(chuàng) 2019-03-09 17:06:40 236
摘要:echo file_get_contents('text.txt'); // 直接獲取文件內(nèi)容strip_tags 去除html標(biāo)記echo strip_tags(file_get_contents('text.txt')); // 獲取去除html標(biāo)記的文件內(nèi)容echo file_get_contents('http://www.baidu.com'

echo file_get_contents('text.txt'); // 直接獲取文件內(nèi)容
strip_tags 去除html標(biāo)記
echo strip_tags(file_get_contents('text.txt')); // 獲取去除html標(biāo)記的文件內(nèi)容
echo file_get_contents('http://www.baidu.com');   // 獲取遠(yuǎn)程文件內(nèi)容
echo file_get_contents('123.jpg');    // 獲取圖片 注意:獲取圖片顯示時(shí)需要聲明頭部
echo file_get_contents('text3.csv'); // 獲取csv格式文件內(nèi)容

var_dump(file_put_contents('text4.txt','PHP中文網(wǎng)學(xué)PHP'));
$str = file_get_contents('text4.txt');
var_dump(file_put_contents('text4.txt',"$str.PHP中文網(wǎng)的老師都很好"));

批改老師:韋小寶批改時(shí)間:2019-03-09 17:29:43
老師總結(jié):file_put_contents和file_get_contents這兩個(gè)函數(shù)是以后使用到差不多最多的 一定要好好去掌握哦 file_get_contents不僅僅可以獲取文件中的內(nèi)容

發(fā)佈手記

熱門詞條