推 wishmeteor:謝謝你的回答~ 04/13 21:29
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.254.130
函數 int fwrite(int fp, string string, int [length])
~~~~~~
這個要放 int fp , 而不是 string filename
寫入檔案的步驟:
1. 開啟檔案
$fp = fopen($myFile, 'a');
fopen後返回到一個 Resource_id , 基本上是用這個id來操作.
(類似 mysql_connect() -> 也會返回 Resouce_id )
2. 寫入資料
fwrite( $fp , $myString);
3. 關閉檔案
fclose($fp);
--