PHP±äÁ¿ºÍ³£Á¿»ù´¡Ñ§Ï°
ÓйرäÁ¿µÄ´«µØÖ·¸³Öµ
PHP 3 ÖУ¬±äÁ¿×ÜÊÇ´«Öµ¸³Öµ¡£PHP 4
ÌṩÁËÁíÍâÒ»ÖÖ·½Ê½¸ø±äÁ¿¸³Öµ£º´«µØÖ·¸³Öµ¡£Ê¹Óô«µØÖ·¸³Öµ£¬¼´¼òµ¥µØ×·¼ÓÒ»¸ö£¨&£©·ûºÅµ½½«Òª¸³ÖµµÄ±äÁ¿Ç°£¨Ô´±äÁ¿£©¡£Öйú×Ôѧ±à³ÌÍø£¬www.zxbc.cn
ÕâÒâζ×ÅеıäÁ¿¼òµ¥µÄÒýÓÃÁËÔʼ±äÁ¿,¸Ä¶¯ÐµıäÁ¿½«Ó°Ïìµ½Ôʼ±äÁ¿£¬·´Ö®ÒàÈ»¡£
<?php
$foo = \'Bob\';
$bar =
&$foo;
$bar = \"My name is $bar\";
echo $bar;
echo $foo;
?>
±äÁ¿fooÖ»ÔÚÊ×Ðб»¸³Öµ£¬Õý³£Ó¦Êä³öΪ“Bob”£¬È»¶ø´«Ö·¸³Öµ¸ø±äÁ¿bar£¬ÔÚ±äÁ¿barÖµ·¢Éú±ä»¯µÄͬʱ£¬±äÁ¿fooµÄÖµÒ²·¢ÉúÁ˱仯¡£
¹ØÓÚ£¨³¬£©È«¾Ö±äÁ¿
PHPÈ«¾Ö±äÁ¿µÄÉùÃ÷ÊÇÔÚÒýÓñäÁ¿Ê±ÉùÃ÷µÄ£¬¶ø·ÇÔÚ³ÌÐòÊ×Ðж¨Òå¡¢¸³Öµ±äÁ¿Ê±À´¶¨ÒåÊÇÈ«¾Ö»¹ÊǾֲ¿±äÁ¿¡£
<?php
$a = 1;
$b = 2;
function Sum()
{
global $a, $b;
$b = $a + $b;
}
Sum();
echo $b;
?>
Èç¹ûº¯ÊýSum()ÄÚûÓÐʹÓÃglobalÉùÃ÷È«¾Ö±äÁ¿£¬³ÌÐò»á±¨´í䶨ÒåµÄ±äÁ¿¡£
µ±È»£¬ÔÚPHPÖл¹ÓÐһЩ±äÁ¿ÔÚij³ÌÐò¹¦ÄÜ·¶Î§ÄÚÊDz»ÐèÒªglobalÉùÃ÷£¬ÕâЩ±äÁ¿³ÆΪ
³¬È«¾Ö±äÁ¿£¬¶øÕâЩ³¬È«¾Ö±äÁ¿»ù±¾¶¼²»ÊÇÓû§×Ô¶¨ÒåµÄ£¬¶øÊÇPHPÔ¤¶¨ÒåµÄһЩ±äÁ¿£¬±ÈÈç $_GET¡¢$_POST¡¢$_COOKIEµÈ¡£
Óйؿɱä±äÁ¿
PHPÖбȽÏÓÐÒâ˼µÄ¿É±ä±äÁ¿£¬±ÈÈç $a=\"bruce\" £¬»¹¿ÉÒÔʹÓà $$a ±íʾΪ $bruce £¬¼´¿É±ä±äÁ¿ÊÇʹÓõÄÁ½¸öÃÀÔª·ûºÅ¡£
µ«ÆäÖÐÔÚ $$a[1] ÖУ¬ÊÇ $a[1] ×÷Ϊһ¸ö±äÁ¿£¬»¹ÊÇ $$a ×÷Ϊһ¸ö±äÁ¿²¢È¡³ö¸Ã±äÁ¿ÖÐË÷ÒýΪ [1] µÄÖµ£¿ÕâÀïûÓÐÇ°ºóµÄÒÀ´Î¹Øϵ£¬¶øÊÇʹÓÃ
${$a[1]} »ò ${$a}[1] À´±íʾÉÏÊöÁ½ÖÖÇé¿ö¡£
¹ØÓÚ³£Á¿
³£Á¿Çø±ðÓÚ±äÁ¿£¬´Ó³£Á¿±»¶¨ÒåÆðÆ䷶Χ¾ÍÊÇÈ«¾ÖµÄ
Á¿Ä¬ÈÏΪ´óСдÃô¸Ð£¬°´ÕÕ¹ßÀý³£Á¿±êʶ·û×ÜÊÇ´óдµÄ
³£Á¿Ç°ÃæûÓÐÃÀÔª·ûºÅ£¨$£©
³£Á¿Ò»µ©¶¨Òå¾Í²»Äܱ»ÖØж¨Òå»òÕßÈ¡Ïû¶¨Òå
³£Á¿Ö»ÄÜÓà define() º¯Êý¶¨Ò壬¶ø²»ÄÜͨ¹ý¸³ÖµÓï¾ä
±ÈÈç define(\"MYNAME\",\"cnbruce\") ¾ÍÊǶ¨ÒåÁËÒ»¸öֵΪ“cnbruce”µÄMYNAME³£Á¿
<?php
define(\"MYNAME\",\"cnbruce\");
$MYNAME=\"cnrose\";
echo
MYNAME;
echo $MYNAME;
?>
ÁíÍ⣬ÈçºÎ½«³£Á¿ºÍ±äÁ¿µÄÖµÒ»ÆðÊä³ö£¬ÕâÐèÒªÉæ¼°µ½PHPµÄ×Ö·û´®ÔËË㣬ʹÓÃÓ¢ÎľäºÅ£¨.£©¿É½«×Ö·û´®Á¬½ÓºÏ²¢³ÉеÄ×Ö·û´®£¬ÀàËÆASPÖеÄ&¡£
echo MYNAME.\",\".$MYNAME; Êä³öΪ“cnbruce,cnr
Ïà¹ØÎĵµ£º
·µ»ØÒ»¸ö½á¹ûÈ«ÊÀ½ç¶¼ÖªµÀÔõô´¦Àí£¬¹Ø¼üÊÇ·µ»Ø¶à¸ö½á¹û¼¯¾Í²»ºÃ°ìÁË£¬ÏÂÃæÓÐÒ»½â¾ö°ì·¨
´æ´¢¹ý³Ì´úÂë
DELIMITER $$;
DROP PROCEDURE IF EXISTS `test`.`sp_test`$$
CREATE PROCEDURE `test`.`sp_test` ()
BEGIN
select * from `user`.`user` limit 0, 50;
select coun ......
½ñÌìÔÚ¼ÒÀïÖØа²×°ÁËÒ»ÏÂPHP µ±ÈÃÒ²ÓÐApacheÁË¡£µ«ÊÇÎÒÓöµ½ÁËÒ»¸öÎÊÌ⣬¾ÍÊÇApache·þÎñÎÞ·¨¿ªÆô£¬ºó¹ûÔõÑùÎÒÏëºÜ¶àÈ˶¼ÊÇÖªµÀµÄ£¬µ±Ê±Ò²Ã»ÓжàÏ룬ÒÔΪÊÇ×Ô¼º°²×°µÄʱºò³öÏÖÁËʧÎó¾ÍÖØа²×°Ò»±é£¬¿ÉÊÇ»¹ÊÇÒ»ÑùÎÞ·¨´ò¿ª£¬È»ºóÎÒ¾ÍÔÚÏëÊÇʲôÎÊÌ⣬¶Ë¿ÚºÅ80.ÎҲ鿴ÁËһϣ¬·¢ÏÖûÓдíÎó°¡£¬Ë¼¿¼Á˺ܾ㬶ÔÍøÂçÒÔ¼°·À» ......
class A extends father{
function __construct() {
echo "abstract<br>";
parent::base(); //¸¸Àà·½·¨
&nb ......
PHP±¾ÉíÊÇÓÐÒ»¸ö¶àάÊý×éÅÅÐòµÄº¯ÊýµÄ¡£
bool
array_multisort
( array
$ar1
[, mixed
$arg
[, mixed
$...
[, array
$...
]]] )
ÏÂÃæÊÇÊֲᵱÖжÔÓÚarray_multisortº¯ÊýµÄÃèÊö£º
array_multisort() ¿ÉÒÔÓÃÀ´Ò»´Î¶Ô¶à¸öÊý×é½øÐÐÅÅÐò£¬»òÕ߸ù¾Ýijһά»ò¶àά¶Ô¶àάÊý×é½øÐÐÅÅÐò¡£
¹ØÁª£¨string ......
1.PHP±à³ÌÄÜÁ¦
2.MysqlÄÜÁ¦
A.Á˽⣺֪µÀʹÓÃPHPÁ´½ÓÊý¾Ý¿â£»¶®µÃһЩ¼òµ¥µÄSQL;½¨Á¢Ò»Ð©¼òµ¥µÄË÷Òý£»¶®µÃÓù¤¾ß¼òµ¥²Ù×÷Ò»ÏÂÊý¾Ý¿â£¨Ôöɾ¸Ä²éÊý¾Ý±í½á¹¹£©¡£
B.ÊìϤ£º¶®µÃÔÚ¿ª·¢Ó¦ÓÃÉÏÉè¼ÆÊý¾Ý¿â£¬½¨Á¢Ò»Ð©ÓÐЧµÄË÷Òý£¬ÓÃexplain·ÖÎöSQLÐÔÄÜ£¬Ñ¹Á¦²âÊԵȵȡ£
C.ºÜÊìϤ£ºÉîÈëÁ˽âÊý¾Ý¿âË÷Òý£¬´æ´¢ÒýÇæÔÀíÒÔ¼°ÔËÐлúÖÆ£ ......