如何用PHP同时获取IP地址、当前时间并写入文件?
- 内容介绍
- 文章标签
- 相关推荐
本文共计74个文字,预计阅读时间需要1分钟。
phpfunction 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);}
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); }
本文共计74个文字,预计阅读时间需要1分钟。
phpfunction 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);}
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); }

