read file
$txt = file_get_contents("http://zhtw.org");
$lines = file("file.txt");
// 把 lines array 串成一起用 \n 分開
$txt = implode("\n", $lines);
$txt= file_get_contents('filename.txt');
// 從第 21 個字元開始,讀去 14 字元長度
$txt= file_get_contents('filename.txt', FALSE, NULL, 20, 14);
write file
$numbercharwrite = file_put_contents($filename, $txt, FILE_APPEND | LOCK_EX);
新增評論