php ÖеÄglobalÒÉ»ó£¡
Ê×ÏÈÎÒÓÐÏÂÃæÕâÑùÁ½¸ö³ÌÐò£¬Ö»ÓÐglobalµÄ˳Ðò²»Ò»Ñù £¬µ«ÊÇÊä³öÎҾ͸㲻¶®ÁË¡£¡£
<?
$a=22;
function f()
{
$a=11;
global $a;
echo "inside the function ".$a." <br>";
}
f();
echo "outside the function ".$a." <br>";
$b=22;
function ff()
{
global $b;
$b=11;
echo "inside the function ".$b." <br>";
}
ff();
echo "outside the function ".$b." <br>";
?>
Êä³öΪ£º
inside the function 22
outside the function 22
inside the function 11
outside the function 11
f()º¯ÊýÖеÄglobal $a£»ÎªÊ²Ã´ÉùÃ÷µÄÊÇÍâÃæÄǸö$a=22;Õâ¸ö±äÁ¿£¬¡£¶øff()º¯ÊýÖеÄglobal $b;ÓÖÊÇÔÚÉùÃ÷ÏÂÃæµÄ$b=11;Õâ¸ö±äÁ¿ÁËÄØ£¿£¿
PHP code:
a=22;
function f()
{
$a=11; //¶¨Òå±äÁ¿$aÖ¸Ïò11
global $a; //¸ü¸Ä±äÁ¿$a,$aÖ¸ÏòÍⲿ±äÁ¿22
echo "inside the function ".$a." <br>";
}
f();
echo "outside the function ".$a." <br>";
$b=22;
function ff()
{
global $b; //±äÁ¿$bÖ¸ÏòÍⲿ22
$b=11; //¸ü¸Ä±äÁ¿$bÖ¸Ïò11
echo "inside the function ".$b."
Ïà¹ØÎÊ´ð£º
±¾ÈËÊÇÒ»¸öC++µÄ³ÌÐòÔ±£¬¹¤×÷¿ì6Ä꣬×î½üÏë×ö¸öÍøÕ¾£¬Ö÷ÒªµÄ¹¹Ë¼ÁË¡£
ѧϰPHP£¬²»ÖªµÀ£¬ÐèҪѧϰЩʲô¶«Î÷£¬»¹ÓоÍÊÇ£¬Ò»°ãÎÒÕâÖÖÇé¿öÒª¶à³¤Ê±¼ä£¬²Å¿ÉÒÔ Ð´Ò»¸öÍøÕ¾£¬ÔÚѧϰ֮ǰÎÊÎÊ£¬Ç°±² ÃÇ¡£
×Ô¼º×öµÄ»°£¬¾ÍÒ ......
ÀýÈçÒ»¾äÎı¾ AAA'BBB\CCC
ÓÃÁË mysql_real_escape_string ºó ¿ÉÒÔ´æ½øÊý¾Ý¿â
µ«¶Á³öÀ´µÄʱºò£¬¾Í³ÉÁË
AAA\'BBB\\\CCC
ÈçºÎ»¹ÔΪ AAA'BBB\CCC
addslashes
stripslashes
[b][/b]ÒýÓÃ
adds ......
¸÷λ´óЩ
ÇóÒ»¶Îphp´úÂë
¿ÉÒÔʵÏÖÒÔϹ¦ÄÜ
Õë¶Ô²»Í¬µÄä¯ÀÀÆ÷ÏÔʾ²»Í¬µÄͼƬ
¾ÍÊÇÓÐÒ»ÕÅͼƬ£¬Ö»Ïë¸øie6Óû§¿´µ½
Èç¹ûie7¡¢chrome¡¢firefoxÓû§ä¯ÀÀÔòÏÔʾÁíÍâÒ»ÕÅͼƬ
¼Û¸ñ²»ÒªÌ«ÀëÆ×¾ÍÐÐ ......
Õâ¸öÊÓÆµ½²µÄºÜÏêϸ, ¶ÔÐÂÊַdz£ÓÐÓÃ, »ù±¾ÉÏÒ»¿´¾Í¶®
ÓÉÓÚÌ«´óÁË(50m, ÎÒÖ»ÄÜÉÏ´«20m), ÎÒÉÏ´«²»ÁË, Ö»ºÃÌù³öÏÂÔØµØÖ·
ÏÂÔØµØÖ·: http://ftel1.3800hk.com/0807/080720djxnzj.rar
ºÃ¶«Î÷,ϸö¿´¿´
......
´úÂëÈçÏ£º
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' ......