php»ñÈ¡¿Í»§¶ËIPµØÖ·µÄ¼¸ÖÖ·½·¨
PHP Code one: //php»ñÈ¡ipµÄËã·¨
$iipp=$_SERVER["REMOTE_ADDR"];
echo $iipp; PHP Code two: //php»ñÈ¡ipµÄËã·¨
$user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR"];
echo $user_IP; function get_real_ip(){
$ip=false;
if(!empty($_SERVER["HTTP_CLIENT_IP"])){
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }
for ($i = 0; $i < count($ips); $i++) {
if (!eregi ("^(10©¦172.16©¦192.168).", $ips[$i])) {
$ip = $ips[$i];
break;
}
}
}
return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}
echo get_real_ip(); PHP Code three: //php»ñÈ¡ipµÄËã·¨
if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"])
{
$ip = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
}
elseif ($HTTP_SERVER_VARS["HTTP_CLIENT_IP"])
{
$ip = $HTTP_SERVER_VARS["HTTP_CLIENT_IP"];
}
elseif ($HTTP_SERVER_VARS["REMOTE_ADDR"])
{
$ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
}
elseif (getenv("HTTP_X_FORWARDED_FOR"))
{
$ip = getenv("HTTP_X_FORWARDED_FOR");
}
elseif (getenv("HTTP_CLIENT_IP"))
{
$ip = getenv("HTTP_CLIENT_IP");
}
elseif (getenv("REMOTE_ADDR"))
{
$ip = getenv("REMOTE_ADDR");
}
else
{
Ïà¹ØÎĵµ£º
°²×°
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/';//phpMyAdminµÄ°²×°Â·¾¶
$cfg['blowfish_secret'] = '123456';//¼ÓÃÜÃܳף¬¿ÉËæÒâ¸ü¸Ä¡£
$cfg['Servers'][$i]['user'] = 'root'; // MySQLÓû§£¬Èç root
$cfg['Servers'][$i]['password'] = 'pswd'; // MySQLÓû§ÃÜÂë
$cfg['DefaultLang'] = '';¡¡¸ÄÎ ......
¿´yii¿ò¼ÜÔ´ÂëµÄʱºò£¬·¢ÏÖÁË
ReflectionClassÕâ¸ö·½·¨£¬²Å·¢ÏÖÔÀ´ÊÇphp5µÄж«Î÷£¬ÓÚÊÇÉÔ΢Ñо¿ÁËÏ¡£phpµÄ·´ÉäapiÒ»¹²ÓУº
class
Reflection
{ }
interface Reflector
{ }
class
ReflectionException
extends
Exception
{ }
class
Re ......
(4)Ó³ÉäÀà(ReflectionClass)
ReflectionClassÀàÔÊÐíÄã·´ÏòÓ³ÉäÀà¡£
<?
php
interface MySerializable
{
// ...}
class My
Object
{
// ...}
/** A counter class */
class
Counter
exten ......
´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬XMLÉùÃ÷·ÅÔÚÎĵµ¶¥²¿¡£ÔÚPHPÖÐÉùÃ÷Ê®·Ö¼òµ¥£ºÖ»ÐèʵÀý»¯Ò»¸öDOMÎĵµÀàµÄ¶ÔÏ󲢸³ÓèËüÒ»¸ö°æ±¾ºÅ¡£²é¿´³ÌÐòÇåµ¥A£º
³ÌÐòÇåµ¥ A
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// display document in browser as plain text ......
CentOSµÄphp°æ±¾Ä¬ÈÏΪ5.1.6£¬È»ºóÔÚ5.2.9°æ±¾Ö®Ç°µÄµÄphp¶¼´æÔÚÒ»¸ö©¶´£¬µ«ÊÇÄ¿Ç°ÍøÉϺܶàµØ·½¶¼ÎÞ·¨Ê¹ÓÃyum update php*Éý¼¶µ½5.2.9£¬±È½Ï³£¼ûµÄÊÇÉý¼¶µ½5.2.6°æ±¾µÄ£¬¾¹ýËÑË÷¹úÍâ×ÊÁÏ£¬ÏÖÔÚÖÕÓÚÕÒµ½Ò»ÖÖÉý¼¶CentOSµÄphpµ½5.2.9µÄ·½·¨¡£
ÔËÐÐÏÂÃæÃüÁ
# wget http://download.fedora.redhat.com/pub/epel/5/i386/ep ......