PHP常用代码总结

一、IP获取:
class getIP{
	function clientIP(){
		$cIP	= getenv('REMOTE_ADDR');
		$cIP1	= getenv('HTTP_X_FORWARDED_FOR');
		$cIP2	= getenv('HTTP_CLIENT_IP');
		$cIP1 ? $cIP = $cIP1 : null;
		$cIP2 ? $cIP = $cIP2 : null;
		return $cIP;
	}
	function serverIP(){
		return gethostbyname($_SERVER_NAME);
	}
}
 
$getIP		= new getIP();
$clientIp	= getIP::clientIP();
$serverIp	= getIP::serverIP();
 
echo 'Client IP is ',$clientIp,'<br />';
echo 'Server IP is ',$serverIp,'<br />';


Zend Studio Enterprise 5.5 注册码

Name:crsky
Code:BC1EF3CD12182039

你可能感兴趣的:(PHP,Zend)