欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php入門學(xué)習(xí)知識(shí)點(diǎn)六 PHP文件的讀寫操作代碼

 更新時(shí)間:2011年07月14日 23:31:28   作者:  
php入門學(xué)習(xí)知識(shí)點(diǎn)六 PHP文件的讀寫操作代碼,讀取文件內(nèi)容 可以用以下兩個(gè)函數(shù)進(jìn)行操作 fread,file_get_contents
復(fù)制代碼 代碼如下:

<?php
//打開文件
$fp=fopen('tmp.html', 'r');
//讀取文件內(nèi)容 可以用以下兩個(gè)函數(shù)進(jìn)行操作 fread,file_get_contents
$str=fread($fp, filesize('tmp.html')); //filesize為獲取文件大小
$content=file_get_contents('tmp.html');
//寫文件
$news=fopen('news.html', 'w');
fwrite($news, $content);
//關(guān)閉文件流
fclose($fp);
fclose($news);
echo $content;
?>

相關(guān)文章

最新評(píng)論