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

PHPÊý×éµÄ×ܽá

 
Ò»¡¢Ê²Ã´ÊÇÊý×é
Êý×é¾ÍÊÇÒ»×éÊý¾ÝµÄ¼¯ºÏ£¬°ÑһϵÁÐÊý¾Ý×éÖ¯ÆðÀ´£¬ÐγÉÒ»¸ö¿É²Ù×÷µÄÕûÌå¡£Êý×éµÄÿ¸öʵÌ嶼°üº¬Á½Ï¼üºÍÖµ¡£
¶þ¡¢ÉùÃ÷Êý¾Ý
ÔÚPHPÖÐÉùÃ÷Êý×éµÄ·½Ê½Ö÷ÒªÓÐÁ½ÖÖ£ºÒ»ÊÇÓ¦ÓÃarray()º¯ÊýÉùÃ÷Êý×飬һÊÇÖ±½ÓΪÊý×éÔªËظ³Öµ¡£
<1>array()º¯ÊýÉùÃ÷µÄÊý×éµÄ·½Ê½array([mixed...]) ²ÎÊýmixedµÄÓ﷨Ϊkey=>value
È磬<?php
$array=array("1"=>"±à","2"=>"³Ì","3"=>"´Ê","4"=>"µä");
print_r($array);
echo "<br>";
echo $array[1]; //×¢Ò⣺ϱêĬÈÏÊÇ´Ó0¿ªÊ¼      
echo $array[2];       
echo $array[3];       
echo $array[4];       
?>
<2>Ö±½ÓΪÊý×éÔªËظ³Öµ¡£Èç¹ûÔÚ´´½¨Êý×éʱ²»ÖªËù´´½¨Êý×éµÄ´óС£¬»òÔÚʵ¼Ê±àд³ÌÐòʱÊý×éµÄ´óС¿ÉÄÜ·¢Éú±ä»¯£¬²ÉÓÃÕâÖÖÊý×é´´½¨µÄ·½·¨½ÏºÃ¡£
È磬<?php
$array[1]="I";
$array[2]="love";
$array[3]="PHP";
print_r($array); //Êä³öËù´´½¨Êý×éµÄ½á¹¹
?>
Èý¡¢Êý×éµÄÀàÐÍ
PHPÖ§³ÖÁ½ÖÖÊý×飺Ë÷ÒýÊý×é(indexed array)ºÍÁªºÏÊý×é(associative array)£¬Ç°ÕßʹÓÃÊý×Ö×÷Ϊ¼ü£¬ºóÕßʹÓÃ×Ö·û´®×÷Ϊ¼ü¡£
ËÄ¡¢Êä³öÊý×é
ÔÚPHPÖжÔÊý×éÔªËØÊä³ö£¬¿ÉÒÔͨ¹ýechoºÍprintÓï¾äÀ´ÊµÏÖ£¬µ«ÕâÖ»ÄܶÔÊý×éÖÐijһԪËؽøÐÐÊä³ö£»Òª½«Êý×é½á¹¹Êä³öÔòҪʹÓÃprint_r()º¯
Êý£¬ÆäÓï·¨£ºprint_r(mixed
expression),²ÎÊýexpressionΪÆÕͨµÄÕûÐΡ¢×Ö·ûÐÍ»òʵÐͱäÁ¿ÔòÊä³ö¸Ã±äÁ¿±¾Éí£¬Èç¹û¸Ã²ÎÊýΪÊý×飬Ôò°´Ò»¶¨¼üÖµºÍÔªËصÄ˳ÐòÏÔʾ³ö
¸ÃÊý×éÖеÄËùÓÐÔªËØ¡£
Îå¡¢Êý×éµÄ¹¹Ôì
һάÊý×飺
µ±Ò»¸öÊý×éµÄÔªËØÊDZäÁ¿Ê±£¬Ôò³ÆÆäΪһάÊý×é¡£
ÉùÃ÷һλÊý×飺 ÀàÐÍ˵Ã÷·û Êý×éÃû[³£Á¿±í´ïʽ]£»
¶þάÊý×飺
µ±Ò»¸öÊý×éµÄÔªËØÊÇÒ»¸öһλÊý×éʱ£¬Ôò³Æ֮Ϊ¶þάÊý×é¡£
È磬<?php
$str = array (
     "ÍøÂç±à³ÌÓïÑÔ"=>array ("PHP","JSP","ASP"),
"ÌåÓýÏîÄ¿"=>array ("m"=>"×ãÇò","n"=>"ÀºÇò"));
print_r ( $str) ;
?>
Áù¡¢±éÀúÊý×é
±éÀ


Ïà¹ØÎĵµ£º

javaºÍphpÊý×Ö´¦ÀíÉÏ

javaʹÓÃMathÀ࣬phpʹÓÃϵͳº¯Êý
ceil¹¦ÄÜ ´óÓÚµÈÓÚijÊý(³£ÓÃÓÚ·ÖÒ³Ò³Êý¼ÆË㣩
phpÖУºceil(a/b)
javaÖУº(int)Math.ceil((double)a/b))    Math.ceilÔÚjavaÖÐÐèÒª´«ÈëdoubleÐÍ£¬¶ø·µ»ØÒ²ÊÇdoubleÐÍ¡£×¢ÒâÕâÀïÓÃ(double)a/b²Å¿ÉÒÔ¡£
a/b,(dobule)(a/b)¶¼²»ÐС£ÒòΪËûÃÇ»áÏÈ×Ô¶¯ÉáÆúСÊýÈ¡µÃÕûÊý
flooe ......

apache php ³£¼ûÎÊÌâ

 linuxÏÂapache+php°²×°³£¼ûÎÊÌâ configure: error: Unable to find libgd.(a|so)
Èç¹ûʹÓõÄÊÇubuntu»òdebian¾ÍºÜ¼òµ¥ÁË£¬Ö±½Ósudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd ¾Í»ù±¾Éϸ㶨£¬µ«ÊÇÓÃÔ´´úÂë°²×°»¹ÊǺÜÂé·³¡«
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0 ......

phpµÄ½Å±¾ÀïÖ±½Ó½¨Á¢mysqlÀïµÄÊý¾Ý¿â

 ÎÊ£º
±ÈÈçÎÒÏëÖ±½ÓÔÚphp µÄ½Å±¾Àïдһ¸öÀàËÆ£¬install.phpµÄ½Å±¾
Õâ¸ö½Å±¾µÄ×÷ÓþÍÊÇ£¬Á¬½ÓmysqlÊý¾Ý¿â£¬²¢½¨Á¢ÎÒËùÏëÒª½¨Á¢µÄÊý¾Ý¿â£¬Êý¾Ý±í£¬ÒÔ¼°Ïà¹Ø×ֶΡ£
Çë¾ßÌåдһ¸öÀý×Ó£¬Ð»Ð»£¡
______________________________________________________________________________________________
´ð1£º
連½Ó·½· ......

[ת]UbuntuÏÂphp¿ª·¢»·¾³ÅäÖÃ(XAMPP)

UbuntuÎÞÒÉÊÇlinux³õѧÕßµÄÊ×Ñ¡°æ±¾£¬ÒòΪËüͼÐνçÃæÖ§³ÖµÄ·Ç³£ºÃ¡£
È»¶øxammpÊÇphp³õѧÕßµÄÊ×Ñ¡¡£
1.ʲôÊÇxammp?
XAMPP£¨Apache+MySQL+PHP+PERL£©ÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄ½¨Õ¾¼¯³ÉÈí¼þ°ü¡£Õâ¸öÈí¼þ°üÔ­À´µÄÃû×ÖÊÇLAMPP£¬µ«ÊÇΪÁ˱ÜÃâÎó½â£¬×îеļ¸¸ö°æ±¾¾Í¸ÄÃûΪ XAMPP ÁË¡£Ëü¿ÉÒÔÔÚWindows¡¢Linux¡¢SolarisÈýÖÖ²Ù×÷ϵͳÏ°² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ