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

¡¾PHPϵÁн̡̳¿(3)——PHPµÄÀàÐÍ

PHPÖ§³Ö8ÖÖԭʼÀàÐÍ£¬ÆäÖаüÀ¨£º
4ÖÖ±êÁ¿ÀàÐÍ£ºboolean(²¼¶ûÐÍ)¡¢integer(ÕûÐÍ)¡¢float(¸¡µãÐÍ)¡¢string(×Ö·ûÐÍ)£»
2ÖÖ¸´ºÏÀàÐÍ£ºarray(Êý×é)¡¢object(¶ÔÏó)£»
2ÖÖÌØÊâÀàÐÍ£ºresource(×ÊÔ´)¡¢NULL
Äú¿ÉÄÜ»¹»á¶Áµ½Ò»Ð©¹ØÓÚ“Ë«¾«¶È£¨double£©”ÀàÐ͵IJο¼¡£Êµ¼ÊÉÏ double ºÍ float ÊÇÏàͬµÄ£¬ÓÉÓÚһЩÀúÊ·µÄÔ­Òò£¬ÕâÁ½¸öÃû³Æͬʱ´æÔÚ¡£
±äÁ¿µÄÀàÐÍͨ³£²»ÊÇÓɳÌÐòÔ±É趨µÄ£¬È·ÇеØ˵£¬ÊÇÓÉ PHP ¸ù¾Ý¸Ã±äÁ¿Ê¹ÓõÄÉÏÏÂÎÄÔÚÔËÐÐʱ¾ö¶¨µÄ¡£
Ò»¡¢ÀàÐ͵ĽéÉÜ
×¢: Èç¹ûÄãÏë²é¿´Ä³¸ö±í´ïʽµÄÖµºÍÀàÐÍ£¬Óà var_dump()¡£
×¢: Èç¹ûÄãÖ»ÊÇÏëµÃµ½Ò»¸öÒ׶Á¶®µÄÀàÐ͵ıí´ï·½Ê½ÓÃÓÚµ÷ÊÔ£¬Óà gettype()¡£Òª²é¿´Ä³¸öÀàÐÍ£¬²»ÒªÓà gettype()£¬¶øÓà is_type º¯Êý¡£ÒÔÏÂÊÇһЩ·¶Àý£º
´úÂë1£º
<?php
$bool = TRUE; // a boolean
$str = "foo"; // a string
$int = 12; // an integer
echo gettype($bool); // prints out "boolean"
echo gettype($str); // prints out "string"
// If this is an integer, increment it by four
if (is_int($int)) {
$int += 4;
}
// If $bool is a string, print it out
// (does not print out anything)
if (is_string($bool)) {
echo "String: $bool";
}
?>
Èç¹ûÄãÒª½«Ò»¸ö±äÁ¿Ç¿ÖÆת»»ÎªÄ³ÀàÐÍ£¬¿ÉÒÔ¶ÔÆäʹÓÃÇ¿ÖÆת»»»òÕß settype() º¯Êý¡£
¶þ¡¢²¼¶ûÐÍ
ÕâÊÇ×î¼òµ¥µÄÀàÐÍ¡£boolean±í´ïÁËÕæÖµ£¬¿ÉÒÔΪTRUE»òÕßFALSE¡£(×¢£º²¼¶ûÀàÐÍÊÇPHP 4Òý½øµÄ)
ÒªÖ¸¶¨Ò»¸ö²¼¶ûÖµ£¬Ê¹Óùؼü×Ö TRUE »ò FALSE¡£Á½¸ö¶¼ÊÇ´óСд²»Ãô¸ÐµÄ¡£
<?php
$foo = True; // assign the value TRUE to $foo
?>
ͨ³£ÄãÓÃijЩÔËËã·û·µ»Ø boolean Öµ£¬²¢½«Æä´«µÝ¸øÁ÷³Ì¿ØÖÆ¡£
// == is an operator which test
// equality and returns a boolean
if ($action == "show_version") {
echo "The version is 1.23";
}
// this is not necessary...
if ($show_separators == TRUE) {
echo "<hr>\n";
}
// ...because you can simply type
if ($show_separators) {
echo "<hr>\n";
}
ÒªÃ÷ʾµØ½«Ò»¸öֵת»»³É boolean£¬Óà (bool) »òÕß (boolean) À´Ç¿ÖÆת»»¡£µ«ÊǺܶàÇé¿öϲ»ÐèÒªÓÃÇ¿ÖÆת»»£¬ÒòΪµ±ÔËËã·û£¬º¯Êý»òÕßÁ÷³Ì¿ØÖÆÐèÒªÒ»¸ö boolean ²ÎÊýʱ£¬¸ÃÖµ»á±»×Ô¶¯×ª»»¡£
µ±×ª»»Îª boolean ʱ£¬ÒÔÏÂÖµ±»ÈÏΪÊÇ FALSE£º
²¼¶ûÖµ FALSE¡¢ÕûÐÍÖµ 0¡¢¸¡µãÐÍ


Ïà¹ØÎĵµ£º

PHP»ù±¾·ûºÅ¼°·½·¨

×¢½â·ûºÅ:
         // µ¥ÐÐ×¢½â    
         /*      */    ¶àÐÐ×¢½â
ÒýºÅµÄʹÓÃ
         ’   ’ µ ......

unubtu Ï Apache php »·¾³µÄ´î½¨

Ò»¡¢ °²×°Apache
¡¡¡¡ÏÂÃ棬ÎÒÃÇÊ×ÏȽéÉÜÈçºÎ°²×°Apache¡£¾ßÌå°²×°ÃüÁîÈçÏÂËùʾ£º
¡¡¡¡$ sudo apt-get install apache2
¡¡¡¡È»ºóÔËÐÐApache£¬ÃüÁîÈçÏÂËùʾ£º
¡¡¡¡$ sudo /etc/init.d/apache2 restart
¡¡¡¡ApacheÔÚ°²×°Æڼ佫»áн¨Ò»¸öĿ¼£º/var/www£¬¸ÃĿ¼ÊǸ÷þÎñÆ÷Öдæ·ÅÎĵµµÄ¸ùĿ¼¡£Ö»ÒªÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÊäÈë ......

PHP Êý×éºÍ×Ö·û´®»¥Ïàת»»

PHP ÖÐÓÉÓÚÊý×éºÍ×Ö·û´®ÕâÁ½ÖÖ±äÁ¿ÀàÐÍÊÇÈç´Ë³£Óã¬ÒÔÖÁÓÚ PHP ¾ßÓÐÁ½¸öº¯Êý£¬¿ÉÒÔÔÚ×Ö·û´®ºÍÊý×éÖ®¼ä»¥Ïà½øÐÐת»»¡£
¡¡¡¡$array=explode(separator,$string);
¡¡¡¡$string=implode(glue,$array);
¡¡¡¡Ê¹ÓúÍÀí½âÕâÁ½¸öº¯ÊýµÄ¹Ø¼üÖ®´¦ÊÇ·Ö¸ô·û£¨separator£©ºÍ½ººÏ·û£¨glue£©¹Øϵ¡£µ±°ÑÒ»¸öÊý×éת»»³ÉÒ»¸ö×Ö·û´®Ê±£¬½«»áÉ ......

PHPÓïÑÔµÄһЩȱÏÝ

1. ¶ÔµÝ¹éµÄ²»Á¼Ö§³Ö
µÝ¹éÊÇÒ»ÖÖº¯Êýµ÷ÓÃ×ÔÉíµÄ»úÖÆ¡£ÕâÊÇÒ»ÖÖÇ¿´óµÄÌØÐÔ¿ÉÒÔ°ÑijЩ¸´ÔӵĶ«Î÷±äµÃºÜ¼òµ¥¡£ÓÐÒ»¸öʹÓõݹéµÄÀý×ÓÊÇ¿ìËÙÅÅÐò£¨quicksort£©¡£²»ÐÒµÄÊÇ£¬PHP²¢²»Éó¤µÝ¹é¡£Zeev£¬Ò»¸öPHP¿ª·¢ÈËÔ±£¬ËµµÀ£º“PHP 4.0£¨Zend£©¶ÔÃܼ¯Êý¾ÝʹÓÃÁËÕ»·½Ê½£¬¶ø²»ÊÇʹÓöѷ½Ê½¡£Ò²¾ÍÊÇ˵ËüÄÜÈÝÈ̵ĵݹ麯ÊýµÄÊýÁ¿ÏÞ ......

PHP»º´æ¼¼ÊõÏê̸

Ò»¡¢ÒýÂÛ
PHP,Ò»ÃÅ×î½ü¼¸ÄêÐËÆðµÄwebÉè¼Æ½Å±¾ÓïÑÔ,ÓÉÓÚËüµÄÇ¿´óºÍ¿ÉÉìËõÐÔ,½ü¼¸ÄêÀ´µÃµ½³¤×ãµÄ·¢Õ¹,phpÏà±È´«Í³µÄaspÍøÕ¾,ÔÚËÙ¶ÈÉÏÓоø¶ÔµÄÓÅÊÆ,Ïëmssqlת6ÍòÌõÊý¾ÝphpÈçÐèÒª40Ãë,asp²»ÏÂ2·ÖÖÓ.µ«ÊÇ,ÓÉÓÚÍøÕ¾µÄÊý¾ÝÔ½À´Ô½¶à,ÎÒÃÇ¿ÊÇóÄܸü¿ìËٵĵ÷ÓÃÊý¾Ý,²»±ØҪÿ´Î¶¼´ÓÊý¾Ý¿âµô,ÎÒÃÇ¿ÉÒÔ´ÓÆäËûµÄµØ·½,±È·½Ò»¸öÎļþ,»òÕßij¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ