我嘗試在寫入條目時寫入新行文本我現在無法使用達時使用時間日期當新條目創建時它將接下來到舊的入口。PHP在新行中添加新文本的文本
05-01-2016, 16:33 - 2016-01-05 04:01:1905-01-2016, 16:33 - 2016-01-05 04:01:20 -01-05 04:01:14a2016-01-05 04:01:15a2016-01-05 04:01:15a2016-01-05 04:01:16
$timezone = "Asia/Colombo";
date_default_timezone_set($timezone);
$today = date("Y-m-d h:m:s");
echo $today;
$myfile = fopen("D:\Log\log.txt", "a") or die("Unable to open file!");
$txt = "user id date";
fwrite($myfile, "a". $today ."\n");
fclose($myfile);
使用'PHP_EOL'新線 – Saty