Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ѧϰ±Ê¼Ç£¨12£©:PHP+MYSQLÁôÑ԰壨ÏÂ

1¡¢Ìá½»±íµ¥JavascriptÑéÖ¤
<form action="" method="post" name="myform" onsubmit="return CheckPost();">
SCRIPT language=javascript>
function CheckPost()
{
 
if (myform.user.value=="")
 {
  alert("ÇëÌîдÓû§");
  myform.user.focus();
  return f ......

ºÜºÃÓõÄphpÖ´ÐÐʱ¼ä·ÖÎö¹¤¾ßwebgrind

ÒÔÇ°·ÖÎöxdebugÓõÄÊÇ£¨wincachegrind£©http://sourceforge.net/projects/wincachegrind/
ÏÖÔÚÖ±½Ó°²×°webgrindÀ´µ÷ÊÔËٶȻá¸üºÃ
http://xdebug.org/
ÏÂÔصØÖ·£º
Source:
xdebug 2.0.3
Windows modules:
PHP 5.1.2-5.1.7
PHP 5.2.1-5.2.6
PHP 5.3.0dev
windows
±à¼­php.ini£¬ÏÈ×¢Ê͵ôzend£º
[Zend]
;zend ......

20¸ö·Ç³£ÓÐÓõÄPHPÀà¿â

ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄPHPÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
ͼ±í¿â
ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªGD¿âµÄÖ§³Ö¡£
pChart - Ò»¸ö¿ÉÒÔ´´½¨Í³¼ÆͼµÄ¿â¡£
Libchart - ÕâÒ²ÊÇÒ»¸ö¼òµ¥µÄͳ¼Æͼ¿â¡£
JpGraph - Ò»¸öÃæÏò¶ÔÏóµÄͼƬ´´½¨Àà¡£
Open Flash Chart - ÕâÊ ......

ʹÓà PHP ´¦Àí XML ÅäÖÃÎļþ


ʹÓà PHP ´¦Àí XML ÅäÖÃÎļþ
ʹÓà XML ÅäÖÃÎļþÇáÒ×µØÅäÖà PHP Ó¦ÓóÌÐòºÍ¶ÔÏó
¼¶±ð£º Öм¶
Vikram Vaswani, ´´Ê¼ÈË, Melonfire
2007 Äê 11 ÔÂ 29 ÈÕ
XML ΪӦÓóÌÐòÅäÖÃÎļþÌṩÁËÒ»ÖÖ±ã½Ý¡¢Ò×Óõıí´ïÓïÑÔ¡£µ«ÓÐʱºò½«ÕâЩÐÅÏ¢ÌáÈ¡µ½ PHP ½Å±¾Öн«»áÃæ¶ÔÒ»¸ö²»Ð¡µÄÌôÕ½¡£ÕâÕýÊÇ XJConf for PHP °ü³öÏÖµÄÔ­Òò£ºËüÌá ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ