Home >Backend Development >PHP Tutorial >PHP 获取IP地址 获取当前时间 写文件

PHP 获取IP地址 获取当前时间 写文件

WBOY
WBOYOriginal
2016-06-23 13:41:401058browse

Mark一下

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); 	}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn