PHP ±à³ÌµÄ 5 ¸öÁ¼ºÃÏ°¹ß
2008 Äê 12 ÔÂ 29 ÈÕ
ÏñÆäËûÓïÑÔÒ»Ñù£¬¿ª·¢ÈËÔ±¿ÉÒÔÓà PHP ±àд³ö¸÷ÖÖÖÊÁ¿¼¶±ðµÄ´úÂ롣ѧϰÁ¼ºÃµÄ±à³ÌÏ°¹ßÄܹ»Ìá¸ß´úÂëÖÊÁ¿ºÍЧÂÊ¡£
¸ù¾Ý¾ßÌåµÄÇé¿ö£¬Ò»°ãµÄ¿ª·¢ÈËÔ±ÍùÍù±ÈÓÅÐãµÄ¿ª·¢ÈËÔ±µÄЧÂÊµÍ 10%~20%¡£ÓÅÐãµÄ¿ª·¢ÈËÔ±µÄЧÂʸü¸ß£¬ÒòΪËûÃÇÓµÓзḻµÄ¾ÑéºÍÁ¼ºÃµÄ±à³ÌÏ°¹ß¡£²»Á¼µÄ±à³ÌÏ°¹ß½«»áÓ°Ï쵽ЧÂÊ¡£±¾ÎÄͨ¹ýչʾһЩÁ¼ºÃµÄ±à³ÌÏ°¹ß£¬°ïÖúÄú³ÉΪ¸üÓÅÐãµÄ³ÌÐòÔ±¡£
ÕâЩÁ¼ºÃµÄ±à³ÌÏ°¹ß²»½öÄÜÌá¸ßЧÂÊ£¬»¹ÄÜÈÃÄú±àд³öÔÚÓ¦ÓóÌÐòµÄÕû¸öÉúÃüÖÜÆÚÖÐÒ×ÓÚά»¤µÄ´úÂë¡£±àд³öÀ´µÄ´úÂë¿ÉÄÜÐèÒª´óÁ¿µÄά»¤£»Ó¦ÓóÌÐòµÄά»¤ÊÇÒ»±ÊºÜ´óµÄ¿ªÖ§¡£Ñø³ÉÁ¼ºÃµÄ±à³ÌÏ°¹ßÄܹ»Ìá¸ßÉè¼ÆÖÊÁ¿£¨±ÈÈçÄ£¿é»¯£©£¬´Ó¶øʹ´úÂë¸ü¼ÓÈÝÒ×Àí½â£¬Òò´Ëά»¤¾Í¸ü¼ÓÈÝÒ×£¬Í¬Ê±Ò²½µµÍά»¤³É±¾¡£
²»Á¼µÄ±à³ÌÏ°¹ß»áÔì³É´úÂëȱÏÝ£¬Ê¹ÆäÄÑÒÔά»¤ºÍÐ޸ģ¬²¢ÇҺܿÉÄÜÔÚÐÞ¸ÄʱÓÖÒýÈëÆäËûȱÏÝ¡£ÒÔÏÂÊÇ 5 ¸öÁ¼ºÃµÄ±à³ÌÏ°¹ß£¬Äܹ»°ïÖú PHP ´úÂë±ÜÃâÕâЩȱÏÝ£º
ʹÓÃÁ¼ºÃµÄÃüÃû¡£
·Ö³É¸üСµÄ²¿·Ö¡£
Ϊ´úÂëÌí¼Ó×¢ÊÍ¡£
´¦Àí´íÎóÌõ¼þ¡£
ÇмÉʹÓø´ÖÆÕ³Ìù¡£
ÏÂһС½Ú½«Ïêϸ½éÉÜÕâЩϰ¹ß¡£
ʹÓÃÁ¼ºÃµÄÃüÃû
ʹÓÃÁ¼ºÃµÄÃüÃûÊÇ×îÖØÒªµÄ±à³ÌÏ°¹ß£¬ÒòΪÃèÊöÐÔÇ¿µÄÃû³ÆÈôúÂë¸ü¼ÓÈÝÒ×ÔĶÁºÍÀí½â¡£´úÂëÊÇ·ñºÃÀí½âÈ¡¾öÓÚÊÇ·ñÄÜÔÚδÀ´Î¬»¤Ëü¡£¼´±ã´úÂë²»´øÓÐ×¢ÊÍ£¬Èç¹ûËüºÜÈÝÒ×Àí½â£¬½«´ó´ó·½±ãÈÕºóµÄ¸ü¸Ä¡£Õâ¸öÏ°¹ßµÄÄ¿±êÊÇÈÃÄú±àдµÄ´úÂëÏñÊé±¾Ò»ÑùÈÝÒ×ÔĶÁºÍÀí½â¡£
²»Á¼Ï°¹ß£ºº¬ºýµÄ»òÎÞÒâÒåµÄÃû³Æ
Çåµ¥ 1 ÖеĴúÂë°üº¬¹ý¶ÌµÄ±äÁ¿Ãû¡¢ÄÑÒÔ±æÈϵÄËõд´Ê£¬²¢ÇÒ·½·¨Ãû²»ÄÜ·´Ó³¸Ã·½·¨µÄ¹¦ÄÜ¡£Èç¹û·½·¨Ãû¸øÈ˵ĸоõÊÇËüÓ¦¸Ã×öÕâ¼þÊÂÇ飬¶øʵ¼ÊÖÐËüÈ´×öÁíÍâµÄÊÂÇ飬Õ⽫´øÀ´ÑÏÖصÄÎÊÌ⣬ÒòΪËü»áÎóµ¼ÈË¡£
Çåµ¥ 1. ²»Á¼Ï°¹ß£ºº¬ºýµÄ»òÎÞÒâÒåµÄÃû³Æ
<?php
function getNBDay($d)
{
switch($d) {
case 5:
case 6:
case 7:
return 1;
default:
return ($d + 1);
}
}
$day = 5;
$nextDay = getNBDay($day);
echo ("Next day is: " . $nextDay . "\n");
?>
Á¼ºÃÏ°¹ß£ºËµÃ÷ÐÔÇ¿²¢ÇÒ¼ò½àµÄÃû³Æ
Çåµ¥ 2 ÖеĴúÂëÌåÏÖÁËÁ¼ºÃµÄ±à³ÌÏ°¹ß¡£Ðµķ½·¨Ãû¾ßÓкÜÇ¿µÄ˵Ã÷ÐÔ£¬·´Ó³ÁË·½·¨µÄÓÃ;¡£Í¬Ñù£¬¸ü¸ÄºóµÄ±äÁ¿ÃûÒ²¸ü¾ß˵Ã÷ÐÔ¡£Î©Ò»µÄ±£³Ö×î¶ÌµÄ±äÁ¿ÊÇ $i£¬ÔÚ±¾Çåµ¥ÖУ¬ËüÊÇÒ»¸öÑ»·±äÁ¿¡£¾¡¹ÜºÜ¶àÈ˲»ÔÞͬʹÓùý¶ÌµÄÃû³Æ£¬µ«ÔÚÑ»·±äÁ¿ÖÐʹÓû¹ÊÇ¿ÉÒÔ½ÓÊܵģ¨ÉõÖÁÓкô¦£©£¬ÒòΪËüÃ÷È·±íÃ÷ÁË´úÂëµÄ¹¦ÄÜ¡£
Ïà¹ØÎĵµ£º
The define() function defines a constant.
define()º¯ÊýµÄ×÷ÓÃÊÇ£º¶¨ÒåÒ»¸ö³£Á¿¡£
Constants are much like variables, except for the following differences:
³£Á¿[constant]Óë±äÁ¿[variable]ÓкܶàÏàËƵĵط½£¬Òò´Ë£¬ºÜÈÝÒ×»ìÏý£»ÏÂÃ棬ÎÒÃÇÁоÙһϳ£Á¿[constant]Óë±äÁ¿[variable]Ö®¼äµÄ²»Í¬µã£º
A const ......
http://www.xhsd.com.cn/books/views.asp?plucode=711126281
Õâ±¾Êé±»³ÆΪPHPºÍMySQLµÄ“Ê¥¾”£¬×Ðϸ¿´ÁËһϣ¬µÄÈ·Óкܶà¶Àµ½µÄµØ·½¡£
Ê×ÏÈ£¬ÄÚÈÝÃ÷È·Í»³ö¡£Õâ±¾ÊéµÄÄ¿µÄÊǶÔPHPºÍMySQL×öÉîÈëdz³öµÄ·ÖÎö£¬¶ÔÆäWebÓ¦ÓÃ×öÁ˽ÏÈ«ÃæµÄ²ûÊö£¬Àý×Ó¾µäʵÓá£
Æä´Î£¬Ð¡£PHP5.3£¬MySQLµÄ´æ´¢¹ý³ÌºÍ´æ´¢ÒýÇ棬Ajax¼¼ ......
PHP4:Ææ¼£±³ºó
1995Äêʱ£¬RasmusÔÚÓÃPHPдËûµÄ¸öÈËÖ÷Ò³£»½ñÌ죬PHP³ÉΪ·çÃÒÈ«ÇòµÄ½Å±¾ÓïÑÔ£¬Ô½À´Ô½¶àµÄÕ¾µãÑ¡ÔñʹÓÃPHP£¬Á¬Yahoo¶¼·ÅÆúÁË×Ô¼ºµÄ½Å±¾¶ø¸ÄÓÃPHPÖ§³ÖËüµÄÍøÕ¾¡£¿ÉÒÔ˵£¬PHPÊÇÒ»¸öÆæ¼£¡£ÎÒÒ»Ö±ÈÏΪ£¬ÈκÎÆæ¼£±³ºó¶¼ÓÐËüµÄÔÒò¡£ÏÖÔÚ£¬¾ÍÈÃÎÒÃÇ͸¹ýÕâ¸öÆæ¼££¬À´¿´¿´PHPµÄ³É¹¦Ö®µÀ¡£
1 ¼òµ¥Ò×ÓÃ
PHPµÄÈëÃÅÃż÷ ......
ÓÃPHPʵÏÖ¼òµ¥µÄÊý¾Ýץȡ
·½·¨Ò»£º
<?php
$urlstr = file_get_contents("http://www.baidu.com");
$urlstr = htmlspecialchars($urlstr);
print_r($urlstr);
?>
·½·¨¶þ£º£¨ÐèÒª´ò¿ªcurlÀ©Õ¹£©
×¢Ò⣺´ò¿ªcurlÀ©Õ¹Ê±£¬Ò»¶¨Òª¿´¿ ......