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

phpʵÏÖµ±Ç°Óû§ÔÚÏßÈËÊý

Ô­Àí£º¸ù¾Ý²»Í¬µÄIPͳ¼Æ³öµ±Ç°ÓжàÉÙÈËÔÚÏß¡£
ʵÏÖ·½Ê½£º¿ÉÒÔÓÃÊý¾Ý¿â£¬Ò²¿ÉÒÔÓÃÎı¾¡£
ÎÒÕâÀïÓÃÁËÎı¾ÊµÏÖ¡£
<?php
/**
*@ Date         2010.04.07
*@ Author       »ªÏÄÖ®ÐÇ PHP100.com
*@ Blog         http://hi.baidu.com/woaidelphi/blog
*/
$user_online = "count.php"; //±£´æÈËÊýµÄÎļþ
touch($user_online);//Èç¹ûûÓдËÎļþ£¬Ôò´´½¨
$timeout = 30;//30ÃëÄÚû¶¯×÷Õß,ÈÏΪµôÏß
$user_arr = file_get_contents($user_online);
$user_arr = explode('#',rtrim($user_arr,'#'));print_r($user_arr);
$temp = array();
foreach($user_arr as $value){
$user = explode(",",trim($value));
if (($user[0] != getenv('REMOTE_ADDR')) && ($user[1] >
time())) {//Èç¹û²»ÊDZ¾Óû§IP²¢Ê±¼äûÓг¬Ê±Ôò·ÅÈëµ½Êý×éÖÐ
array_push($temp,$user[0].",".$user[1]);
}
}
array_push($temp,getenv('REMOTE_ADDR').",".(time() + ($timeout)).'#');
//±£´æ±¾Óû§µÄÐÅÏ¢
$user_arr = implode("#",$temp);
//дÈëÎļþ
$fp = fopen($user_online,"w");
flock($fp,LOCK_EX); //flock() ²»ÄÜÔÚNFSÒÔ¼°ÆäËûµÄÒ»Ð©ÍøÂçÎļþϵͳÖÐÕý³£¹¤×÷
fputs($fp,$user_arr);
flock($fp,LOCK_UN);
fclose($fp);
echo "µ±Ç°ÓÐ".count($temp)."ÈËÔÚÏß";
?>


Ïà¹ØÎĵµ£º

phpÖÐpear°²×°³öÏÖ´íÎó

      ×î½üÏë°²×°PEAR(PHP Extension and Application Repository),µ«ÊÇÔÚÖ´ÐÐÅú´¦ÀíÎļþgo-pear.batµÄʱºò³öÏÖÁË´íÎó£º
phar "C:\php\PEAR\go-pear.phar" does not have a signature
PHP Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: ......

PHPÖжàάÊý×éµÄÅÅÐò

1.Óû§¶¨ÒåÅÅÐò£ºusort($array, functionName);ÆäÖÐfunctionNameΪÓû§¶¨ÒåµÄº¯ÊýÃû£¬Óû§¶¨ÒåµÄº¯ÊýÖ¸¶¨ÅÅÐò¹æÔò£¬±È½ÏÊý×éÖÐÁ½¸öÔªËØµÄ´óС£¬´óÓÚ·µ»ØÕýÊý£¬Ð¡ÓÚ·µ»Ø¸ºÊý£¬µÈÓÚ·µ»Ø0¡£2.·´ÏòÓû§ÅÅÐò£ºÓû§¶¨Ò庯Êýʱ£¬±È½ÏÊý×éÖÐÁ½¸öÔªËØµÄ´óС£¬´óÓÚ·µ»Ø¸ºÊý£¬Ð¡ÓÚ·µ»ØÕýÊý£¬µÈÓÚ·µ»Ø0¡£$fruits = array(array('APP', ' ......

php º¯Êý

htmlspecialchars()    
º¯Êý°ÑһЩԤ¶¨ÒåµÄ×Ö·ûת»»Îª HTML ʵÌå¡£
      ENT_COMPAT - ĬÈÏ¡£½ö±àÂëË«ÒýºÅ¡£
          eg:" £¨Ë«ÒýºÅ£© ³ÉΪ &quot;
implode()    
º¯Êý°Ñ
Êý×éÔªËØ×éºÏΪһ¸ö×Ö ......

³£ÓÃʱ¼ä¸ñʽÓëPHPʱ¼ä¸ñʽÏ໥ת»»

ÎÄ/Fenying
 
¡¡¡¡ÀýÈçÓг£ÓÃʱ¼ä¸ñʽ yyyy-mm-dd HH:ii:ss£¬ÈçºÎת»»³ÉPHPÖÐdateº¯Êý¿ÉʹÓõÄʱ¼ä¸ñÊ½ÄØ£¿
¡¡¡¡Ê¹ÓàPHPTimeFormatfromCommon() ¿ÉÒÔ°ÑͨÓÃʱ¼ä¸ñʽת»»³ÉPHPʱ¼ä¸ñʽ
¡¡¡¡¡¡¡¡PHPTimeFormatfromCommon('yyyy-mm-dd HH:ii:ss') => 'Y-m-d H:i:s'
¡¡¡¡Ê¹Óà PHPTimeFormatToCommon() ¿ÉÒÔ° ......

ÊÖ¶¯ÅäÖÃnginx+php cgi+zend+mysql

±¾ÎÄÊʺÏCentOS¡£Ò»²½Ò»²½À´£¬²»Òª´í¡£
ÏÈÏÂÔØ¹¤¾ßssh shell£¬¸öÈ˸оõÕâ¸ö±È½ÏºÃÓã¬ÍƼö¸ø´ó¼Ò
http://docs.isvps.net/soft/SSHSecureShellClient-3.2.9.zip
È»ºóÊÇһЩ±ØÒªµÄÈí¼þ°ü
nginxÔ´Âë°ü: http://www.nginx.org/download/nginx-0.7.65.tar.gz
phpÔ´Âë°ü: http://cn.php.net/distributions/php-5.2.11.tar.gz ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ