PHP²ËÄñÇóÖú
<?php
//¾²Ì¬±äÁ¿
function myfunc(){
static $mystr;
$mystr = "¹þ";
echo $mystr."<br>\n";
}
myfunc();
myfunc();
myfunc();
?>
¸÷λÄÜ°ïÎÒÈ·¶¨ÏÂÊä³öô£¿ÄܸæËßÎÒΪʲôô£¿Ð»Ð»£¡
¹þ
¹þ¹þ
¹þ¹þ¹þ
ÊÇÕâ¸ö½á¹û°É?
¹þ <br>
¹þ <br>
¹þ <br>
staticÊǾ²Ì¬±äÁ¿£¬ÊÇÔÚ±àÒëµÄʱºò·ÖÅäÄÚ´æ¿Õ¼ä£¬Ò»°ã±äÁ¿ÊÇÔÚÔËÐÐʱ·ÖÅäÄÚ´æ¿Õ¼ä¡£
²»¹ýÄãÕâ¸öËƺõûʲôÓÃ
PHP code:
¹þ
¹þ
¹þ
×¢£º<br>Òþ²ØÁË
¹þ
¹þ
¹þ
staticÔÚÕâ¸ö³ÌÐòÀïûÓÐÓá£
ºÇºÇ ¿´À´ÊÇ°¡ £¬
µ«ÊÇÎÒ²»ÖªµÀ ÔÀí£¬Àý×Ó˵ÊÇstaticÓÐÓõģ¬²»ÖªµÀΪʲôûÓÃÁË°¡
²»Çå³þphpÔËÐÐÔÀí£¬Ï£ÍûËÄÜÖ¸½Ì°¡
ËÄܽ²ÏÂÔÀí°¡ °ÝÍдó¼Ò
ÄãµÄÕâ¸öÎÊÌ⣬ÊÇÄãÀí½â´íÁ˾²Ì¬±äÁ¿µÄÓ÷¨£¡ÄãÏȽ«ÎҵĴúÂëÔËÐÐÊÔÊÔ£º
<?php
//¾²Ì¬±äÁ¿
function myfunc(){
static $mystr;
$mystr .= "¹þ";
echo $mystr."<br>";
}
myfunc();
myfunc();
myfunc();
?>
±¸×¢
Ïà¹ØÎÊ´ð£º
´úÂëÈçÏ£º
function uc_get_user($username, $isuid=0) {
$return = call_user_func(UC_API_FUNC, 'user', 'get_user', array('username'=>$username, 'isuid'=>$isuid));
return UC_CONNECT == 'mysql' ......
PHP code:
$date = '2009-12-25';
$ptn = '/([\d]{4})[- \/](0?[\d]|1[0-2])[-\/ ](0?[\d]|[1-2][\d]|3[0-1])/';
if (preg_match($ptn,$date,$out))
{
print_r($out);exit();
}
½á¹ûΪ:
PHP code:
......
ÎÒ°²×°µÄÕâ¸öÈí¼þVertrigoServ£¬ÔÚwindows7ÖÐÔËÐУ¬Í¼±ê¼ÓºÅΪÀ¶É«£¬±¨MySQLµÄ´íÎó£¬Çë½Ì¸÷λ¸ßÊÖ¸ÃÔõÑù¸ü¸Ä¡£Ð»Ð»¸÷λ£¡
mysql ·þÎñÊÇ·ñÆðÀ´ÁË£¿
ûÓУ¬±¨µÄÊǶ˿ڴíÎó£¬ÔÚÅäÖÃÎļþµ±ÖиÄÁË£¬Ò²²»ÐÐ
¿ÉÒÔÓÃÈ ......
ÎÒÔÚ¼¯³É¹¤¾ßWAMP5ÖУ¬Ïëд¸öº¯Êý²âÊÔ²âÊÔ£¬¿ÉÊǽá¹ûÔõô»á¸øÎÒ±¨´í£¿£¿£¿ÊDz»ÊÇÅäÖÃÎļþûÐ޸ģ¬Çë½Ì¸÷λ´óϺÃÇ¡£
Äǿ϶¨Ä㺯ÊýÊÇÓÐÎÊÌâµÄÁË
·¢À´¿´¿´°É
ÐÐÁË£¬Ã÷°×ÊÇʲôÎÊÌâÁË£¬Ð»Ð»ÁË£¡£¡£¡£¡
<?ph ......