===============写文件===============$realfiepath = d:/test.txt;$filecontent = test 2011 03 12.; $file = fopen($realfiepath, 'wb');fwrite($file, $filecontent );fclose($file); ===============读文件===============$realfiepath = d:/test.txt;$size = intval(sprintf(%u, filesize($realfiepath)));$handle = fopen($realfiepath, rb);$filecontent = ; while (!feof($handle)) { $filecontent .= fread($handle, $size); ob_flush(); flush(); } fclose($handle); echo $filecontent ;
复制代码