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)."ÈËÔÚÏß";
?>
Ïà¹ØÎĵµ£º
×î½üÏë°²×°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: ......
1.Óû§¶¨ÒåÅÅÐò£ºusort($array, functionName);ÆäÖÐfunctionNameΪÓû§¶¨ÒåµÄº¯ÊýÃû£¬Óû§¶¨ÒåµÄº¯ÊýÖ¸¶¨ÅÅÐò¹æÔò£¬±È½ÏÊý×éÖÐÁ½¸öÔªËØµÄ´óС£¬´óÓÚ·µ»ØÕýÊý£¬Ð¡ÓÚ·µ»Ø¸ºÊý£¬µÈÓÚ·µ»Ø0¡£2.·´ÏòÓû§ÅÅÐò£ºÓû§¶¨Ò庯Êýʱ£¬±È½ÏÊý×éÖÐÁ½¸öÔªËØµÄ´óС£¬´óÓÚ·µ»Ø¸ºÊý£¬Ð¡ÓÚ·µ»ØÕýÊý£¬µÈÓÚ·µ»Ø0¡£$fruits = array(array('APP', ' ......
htmlspecialchars()
º¯Êý°ÑһЩԤ¶¨ÒåµÄ×Ö·ûת»»Îª HTML ʵÌå¡£
ENT_COMPAT - ĬÈÏ¡£½ö±àÂëË«ÒýºÅ¡£
eg:" £¨Ë«ÒýºÅ£© ³ÉΪ "
implode()
º¯Êý°Ñ
Êý×éÔªËØ×éºÏΪһ¸ö×Ö ......
ÎÄ/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() ¿ÉÒÔ° ......
±¾ÎÄÊʺÏ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 ......