close

主要是用在PHP寫入LOG檔

使用file_put_contents()並帶入正確參數,如下:

file_put_contents('logs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);

--

 

Try something like this:

 $txt = "user id date";
 $myfile = file_put_contents('logs.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);

 

--

轉自 https://stackoverflow.com/questions/24972424/create-or-write-append-in-text-file

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 dizzy03 的頭像
    dizzy03

    碎碎念

    dizzy03 發表在 痞客邦 留言(0) 人氣()