Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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
{


Ïà¹ØÎĵµ£º

¹ØÓÚPHPºÍphpMyAdminµÄÄÇЩÊÂ


°²×°
$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'] = '';¡¡¸ÄÎ ......

ѧϰphp Reflection£¨Ò»£©

¿´yii¿ò¼ÜÔ´ÂëµÄʱºò£¬·¢ÏÖÁË
ReflectionClassÕâ¸ö·½·¨£¬²Å·¢ÏÖÔ­À´ÊÇphp5µÄж«Î÷£¬ÓÚÊÇÉÔ΢Ñо¿ÁËÏ¡£phpµÄ·´ÉäapiÒ»¹²ÓУº
class 
Reflection 
{ }
interface Reflector 
{ }
class 
ReflectionException 
extends 
Exception 
{ }
class 
Re ......

ѧϰphp Reflection£¨¶þ£©

(4)Ó³ÉäÀà(ReflectionClass)
ReflectionClassÀàÔÊÐíÄã·´ÏòÓ³ÉäÀà¡£
<?
php
interface MySerializable  
{    
// ...}
class My
Object
 
{    
// ...}
/** A counter class */
class 
Counter 
exten ......

PHP+DOM´´½¨XMLÎļþ

´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬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ͨ¹ýyumÉý¼¶phpµ½5.2.9°æ±¾µÄ·½·¨

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ