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

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;
}
Àý×Ó
ÏÂÃæµÄÀý×Óʾ·¶ÁËÒ»¸öÑ­»·£¬Õâ¸öÑ­»·¿ÉÒÔÊä³ö¸ø¶¨


Ïà¹ØÎĵµ£º

[ת]phpÖж¨½ç·û<<<µÄ×÷ÓÃ


phpÖж¨½ç·û<<<µÄ×÷Óà - [phpÓï
ÑÔ
]
[Time:2009-08-18]
°æȨÉùÃ÷
£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
ת×Ô:http://star210.blogbus.com/logs/44486135.html
ÒòΪPHPÊÇÒ»¸öWeb±à³ÌÓïÑÔ£¬ÔÚ±à³Ì¹ý³ÌÖÐÄÑÃâ»áÓöµ½ÓÃechoÀ´Êä³ö´ó¶ÎµÄhtmlºÍjavascript
½Å
±¾µÄÇé¿ö£¬Èç¹ûÓô«Í³µÄÊ ......

PHPºǫ́³ÌÐò¶ÔLINUXÐźŵĴ¦Àí

PHPÔÚÔËÐеÄʱºò£¬Ö±½Ókillµô£¬ÓпÏÄÜÔì³ÉÊý¾ÝµÄ¶ªÊ§¡£ÐÒºÃphpÄ£¿é£¬ÓÐÕë¶ÔsignalµÄ´¦Àí¡£
´¦Àí·½Ê½£¬Ê×Ïȼì²éÓÐûÓа²×° PCNTL Ä£¿é
È»ºó¿ÉÒÔÔÚÒ»¸ö°üº¬ÎļþÖУ¬Ìí¼ÓÒÔÏ´úÂë
global $exitFlag;
$exitFlag = false;
// Ôö¼ÓlinuxÐźÅÁ¿´¦Àí
if (DIRECTORY_SEPARATOR != '\\') {
    pcntl_signal(SI ......

10 ¼þ£¨Ò²Ðí£©Äã²»Á˽â PHP µÄÊÂÇé

PHP
ÊÇÎÒÓùýµÄÓïÑÔÖУ¬×îÁîÈËÄÕ»ðµÄµ«Í¬Ê±Ò²ÊÇ×îÓÐȤµÄÓïÑÔ¡£ÎÒÖ®ËùÒÔ˵“ÁîÈËÄÕ»ð”Ö÷ÒªÊÇÒòΪº¯ÊýÃüÃû¼«Æä²»Ò»Ö¡£¾¡¹ÜÎÒÿÌ춼ҪÓõ½ÕâЩº¯Êý£¬ÎÒ»¹ÊÇÒªÏë
һϓ¾¿¾¹ÊÇ str_pos »¹ÊÇ strpos£¿ÊÇ str_split »¹ÊÇ
strsplit£¿”¡£ÁíÒ»·½Ã棬ÓÐʱºò¿ÉÒÔÓÃÒ»Ðмòµ¥µÄ´úÂë¾ÍÄܽâ¾öÒ»¸öÄÑÌâ¡£
ÏÂÃæ ......

21¸öʵÓñãÀûµÄPHP´úÂë

1. PHP¿ÉÔĶÁËæ»ú×Ö·û´®
´Ë´úÂë
½«´´½¨Ò»¸ö¿ÉÔĶÁµÄ×Ö·û´®£¬Ê¹Æä¸ü½Ó½ü´ÊµäÖеĵ¥
´Ê£¬ÊµÓÃÇÒ¾ßÓÐÃÜÂëÑéÖ¤¹¦ÄÜ¡£
/**************
[email=*@length]*@length[/email] - length of random string (must be a
multiple of 2)
**************/
function readable_random_string($length = 6){
    $conso= ......

ÅäÖÃApacheµÄ·ÃÎÊĿ¼£¨for PHP£©

       ÔÚĬÈÏÇé¿öÏ£¬phpµÄÏîÄ¿ÐèÒª½¨ÔÚApache Group\Apache\htdocsĿ¼Ï²ſÉÒÔÕý³£·ÃÎÊ¡£µ±ÎÒÃÇÐèÒª×Ô¼º½¨Á¢Ò»¸ö²»ÔÚApache Group\Apache\htdocsĿ¼ÏµĹ¤×÷Çø¼äʱ£¬¾ÍÐèÒª¸Ä±äApacheµÄ·ÃÎÊÖ¸¶¨Â·¾¶¡£°²×°ºÃApache ºó£¬ÔÚApache Group\Apache\conf ÏÂÓÐÒ»¸öÎļþhttpd.conf£¬ËüÀïÃæ°üº¬×Å ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ