Mark一下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function WriteIPMark($strFile) { $ip=$_SERVER["REMOTE_ADDR"]; $str_date = date('Y-m-d H:i:s',time()); $fp = fopen($strFile, "a"); if($fp) { fwrite($fp,$ip); fwrite($fp," "); fwrite($fp,$str_date); fwrite($fp,"\r\n"); } fclose($fp); } |
转载请注明:exchen's blog » PHP 获取IP地址 获取当前时间 写文件