PHP Ñ»·
PHP ÖеÄÑ»·Óï¾äÓÃÓÚÖ´ÐÐÏàͬµÄ´úÂë¿éÖ¸¶¨µÄ´ÎÊý¡£
Ñ»·
ÔÚÄú±àд´úÂëʱ£¬Äú¾³£ÐèÒªÈÃÏàͬµÄ´úÂë¿éÔËÐкܶà´Î¡£Äú¿ÉÒÔÔÚ´úÂëÖÐʹÓÃÑ»·Óï¾äÀ´Íê³ÉÕâ¸öÈÎÎñ¡£
ÔÚ PHP ÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÁÐÑ»·Óï¾ä£º
while Ö»ÒªÖ¸¶¨µÄÌõ¼þ³ÉÁ¢£¬ÔòÑ»·Ö´ÐдúÂë¿é do...while Ê×ÏÈÖ´ÐÐÒ»´Î´úÂë¿é£¬È»ºóÔÚÖ¸¶¨µÄÌõ¼þ³ÉÁ¢Ê±Öظ´Õâ¸öÑ»· for Ñ»·Ö´ÐдúÂë¿éÖ¸¶¨µÄ´ÎÊý foreach ¸ù¾ÝÊý×éÖÐÿ¸öÔªËØÀ´Ñ»·´úÂë¿é
while Óï¾ä
Ö»ÒªÖ¸¶¨µÄÌõ¼þ³ÉÁ¢£¬while Óï¾ä½«Öظ´Ö´ÐдúÂë¿é¡£
Óï·¨
while (condition)
code to be executed;
Àý×Ó
ÏÂÃæµÄÀý×Óʾ·¶ÁËÒ»¸öÑ»·£¬Ö»Òª±äÁ¿ i СÓÚ»òµÈÓÚ 5£¬´úÂë¾Í»áһֱѻ·Ö´ÐÐÏÂÈ¥¡£Ñ»·Ã¿Ñ»·Ò»´Î£¬±äÁ¿¾Í»áµÝÔö 1£º
<html>
<body>
<?php
$i=1;
while($i<=5)
{
echo "The number is " . $i . "<br />";
$i++;
}
?>
</body>
</html>
do...while Óï¾ä
do...while Óï¾ä»áÖÁÉÙÖ´ÐÐÒ»´Î´úÂë - È»ºó£¬Ö»ÒªÌõ¼þ³ÉÁ¢£¬¾Í»áÖØ¸´½øÐÐÑ»·¡£
Óï·¨
do
{
code to be executed;
}
while (condition);
Àý×Ó
ÏÂÃæµÄÀý×Ó½«¶Ô i µÄÖµ½øÐÐÒ»´ÎÀÛ¼Ó£¬È»ºó£¬Ö»Òª i СÓÚ 5 µÄÌõ¼þ³ÉÁ¢£¬¾Í»á¼ÌÐøÀÛ¼ÓÏÂÈ¥£º
<html>
<body>
<?php
$i=0;
do
{
$i++;
echo "The number is " . $i . "<br />";
}
while ($i<5);
?>
</body>
</html>
for Óï¾ä
Èç¹ûÄúÒѾȷ¶¨ÁË´úÂë¿éµÄÖØ¸´Ö´ÐдÎÊý£¬Ôò¿ÉÒÔʹÓà for Óï¾ä¡£
Óï·¨
for (initialization; condition; increment)
{
code to be executed;
}
×¢ÊÍ£ºfor Óï¾äÓÐÈý¸ö²ÎÊý¡£µÚÒ»¸ö²ÎÊý³õʼ»¯±äÁ¿£¬µÚ¶þ¸ö²ÎÊý±£´æÌõ¼þ£¬µÚÈý¸ö²ÎÊý°üº¬Ö´ÐÐÑ»·ËùÐèµÄÔöÁ¿¡£Èç¹û initialization »ò increment ²ÎÊýÖаüÀ¨Á˶à¸ö±äÁ¿£¬ÐèÒªÓöººÅ½øÐзָô¡£¶øÌõ¼þ±ØÐë¼ÆËãΪ true »òÕß false¡£
Àý×Ó
ÏÂÃæµÄÀý×Ó»á°ÑÎı¾ "Hello World!" ÏÔʾ 5 ´Î£º
<html>
<body>
<?php
for ($i=1; $i<=5; $i++)
{
echo "Hello World!<br />";
}
?>
</body>
</html>
foreach Óï¾ä
foreach Óï¾äÓÃÓÚÑ»·±éÀúÊý×é¡£
ÿ½øÐÐÒ»´ÎÑ»·£¬µ±Ç°Êý×éÔªËØµÄÖµ¾Í»á±»¸³Öµ¸ø value ±äÁ¿£¨Êý×éÖ¸Õë»áÖðÒ»µØÒƶ¯£© - ÒÔ´ËÀàÍÆ¡£
Óï·¨
foreach (array as value)
{
code to be executed;
}
Àý×Ó
ÏÂÃæµÄÀý×Óʾ·¶ÁËÒ»¸öÑ»·£¬Õâ¸öÑ»·¿ÉÒÔÊä³ö¸ø¶¨
Ïà¹ØÎĵµ£º
×î½üÓÐÈËÔÚÕбêÒª×ö¸öÏñ£ºwww.webjianzhi.com ÕâÑùµÄÈ˲ÅÕ¾£¬³õ¿´£¬Õâ¸öÍøÂç¼æÖ°Íø£¬½çÃæ»¹ÊDZȽÏÇåÎúµÄ¡£
ÕûÌå·ÖÎöÁËһϣ¬Ò»¸öÐÂÎÅÎÄÕ·¢²¼ÏµÍ³£¬Õâ¸ö²»ÊǺÜÄÑ£¬ÁíÒ»¸ö¾ÍÊÇ×ֶε÷ÓÃϵͳ£¬¾ÍÊÇÊ×Ò³µÄÖ°Òµ½éÉÜ£¬¼æÖ°ÈËÆø£¬µÄÕâЩµ÷Óá£
ÁíÒ»¸ö¾ÍÊÇ»áÔ±·¢²¼ÏµÍ³¡£
Õû¸öÓñí¸ñ²¼¾Ö£¬ÃÀ¹¤Éϲ»´æÔ ......
<?php
$p=new ReflectionClass(Àà¶ÔÏó);
$constants=$p->getConstants();//const ¶¨Òå³£Á¿
$properties=$p->getProperties();//ËùÓбäÁ¿ÊôÐÔ
$methods=$p->getMethods();//ËùÓз½·¨
//È«²¿ÒÔÊý×éÐÎÊÆ·µ»Ø
?> ......
È·±£ÄãµÄ´úÂëÕý³£¹¤×÷ÊDzâÊÔµÄÊ×ÒªµÄÄ¿µÄ£¬µ«ÊÇÔÚ²âÊÔÄãµÄ´úÂëʱºò£¬ÄãÓ¦¸ÃÈÏʶµ½³ý´Ë
Ö®Í⻹ÓÐһЩ¶îÍâµÄ£¬Ïà¶Ô´ÎÒªµÄÄ¿µÄ£º
1¡¢²âÊÔÈÃÄãÊéдÈÝÒײâÊԵĴúÂë¡£ÕâʹµÃ´úÂëËÉÉ¢ñîºÏ£¬¸´ÔÓÉè¼Æ£¬¶øÇÒ¾ßÓÐ
ºÜºÃµÄÄ£¿éÐÔ¡£
2¡¢²âÊÔÄÜÈÃÄãÇåÎúµÄÁ˽âÔËÐдúÂëµÄÆÚÍû½á¹û£¬ÈÃÄã´ÓÒ»¿ªÊ¼¾Í×¢ÖØÓÚÄ£¿éµÄ
Éè¼ÆºÍ·ÖÎö¡£Í¨¹ý²âÊÔ£¬ ......
GyPSiiÀûÓÃXML-RPC£¬PHPÀïXML-RPCµÄÏà¹ØÓ¦ÓÃʾÀýºÜ¶à£¬²é²éÊֲᡢGOOGLEһϾͿÉÒÔÕÒµ½ºÜ¶à¡£GyPSii APIÀïÌṩÁËÒ»¸ö²Ù×÷ÀàÓÃÀ´ÇëÇó·þÎñ£¬²¢ÌṩÁËÒ»¸öÇëÇóº¯Êý£¬Ö»Òª½«´Ëº¯Êý·Å½ø²Ù×÷ÀàÀ¾Í¿ÉÒÔ·½±ãµÄʹÓÃÁË£¬º¯ÊýÈçÏ£º
function GyPSiiXMLRPC( $uri, $host, $pid, $body="" ) {
$this->addHeader( 'Content-T ......
ÎÒд¹ýµÄ½Ì³Ì²»¶à£¬¶øÇҴ󲿷ֶ¼ÊÇÀ´Ô´ÓÚ±ðÈ˵Ľ̳̣¬²»¹ý£¬ÕâÀïËù½éÉܵ쬶¼ÊÇÈÚÈëÎÒËù×ܽáµÄ¾Ñ飮££ÒýÑÔ
¡¡¡¡
¡¡¡¡PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔÒòÖ®Ò»£¬ºÍËü³ÆÎª¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËĿǰ×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆÐ´Í ......