[";
foreach ($data as $key => $value)
{
$wstring.= $key.":".$value.",";
}
$wstring .= "]\n";
$f_open = fopen($filename, "a+") or die("file is not exist");
fwrite($f_open, $wstring);
fclose($f_open);
}
//¶Á¼Ç¼
function ReadNote($date1, $date2, $time1, $time2)
{
$dir = dirname(__FILE__)."\\note\\";
//´«½øµÄʱ¼ä
$starTime = $date1." ".$time1;
$endTime = $date2." ".$time2;
if (!is_dir($dir))
{
return "can find nothing";
}
$showInfo = "";
$curDate = strtotime($date1);
while ($curDate <= strtotime($date2))
{
//Òª²éÕÒµÄÎļþÃû
$filename= $dir.date("Y-m-d", $curDate).".txt";
//²»´æÔÚ¸Äʱ¼äµÄÎļþ
if (!file_exists($filename))
{
$curDate = strtotime('+1 day', $curDate);
continue;
#return date("Y-m-d", $curDate).":can find nothing";
}
//´ò¿ªÎļþ
$fopen = fopen($filename, "rb") or die("file is not exist");
while(!feof($fopen))
{
$lineInfo = fgets($fopen);
$timeList = explode('=>[', $lineInfo);
$noteTime = $timeList[0];
if (strtotime($noteTime) >= strtotime($starTime) && strtotime($noteTime) <= strtotime($endTime))
{
$showInfo .= $lineInfo."