Re: [請益] php 字串寫入檔案

看板PHP作者 (發抖)時間16年前 (2008/04/13 17:42), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/3 (看更多)
函數 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); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.73.254.130

04/13 21:29, , 1F
謝謝你的回答~
04/13 21:29, 1F
文章代碼(AID): #180TLuGy (PHP)
文章代碼(AID): #180TLuGy (PHP)