[ת]PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
±¾ÎÄÖ÷ÒªÊǽéÉÜÔÚ PHP µÄ±à³ÌÖУ¬ÈçºÎÇÉÓÃÊý×éÀ´½µµÍÒò¶à²ãÑ»·¶øÒýÆðµÄʱ¼ä¸´ÔӶȵÄÎÊÌâ¡£ÌرðÊǵ±³ÌÐòÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»¥Ê±£¬Óô˷½·¨À´ÓÅ»¯ÄãµÄ´úÂ룬½«»á´ø¸øÒâÏë²»µ½µÄЧ¹û¡£
ͨ³£¿ª·¢ÈËÔ±ÔÚд³ÌÐòµÄʱºò£¬ÍùÍùÊÇ°ÑÒѾÉè¼ÆºÃ»òÕß¹¹Ë¼ºÃµÄÔËËãÂß¼£¬Ö±½ÓÓñà³ÌÓïÑÔ·Òë³öÀ´¡£³ÌÐòÄÜ˳Àû±àÒëͨ¹ý£¬ÄÇÊǺÜÁîÈ˸ßÐ˵ÄÊÂÇé¡£Èç¹û´Ëʱ³ÌÐòµÄÔËÐÐʱ¼ä»¹ÄܽÓÊÜ£¬¾Í»á³Á½þÔÚд´úÂëµÄ³É¾Í¸Ðµ±ÖУ¬³£³£ÔÚÕâ¸ö¹ý³ÌÖкöÂÔ´úÂëµÄÓÅ»¯¡£Ö»Óе±³ÌÐòÔËÐÐËÙ¶ÈÊܵ½Ó°Ïìʱ£¬²Å»Ø¹ýÍ·È¥¿¼ÂÇÓÅ»¯µÄÊÂÇé¡£
ʲôÊÇËã·¨µÄʱ¼ä¸´ÔÓ¶È
ʱ¼ä¸´ÔÓ¶ÈÊÇ¿ª·¢ÈËÔ±ÓÃÀ´ºâÁ¿Ó¦ÓóÌÐòËã·¨ÓÅÁÓµÄÖ÷ÒªÒòËØ¡£¿Í¹ÛµØ˵£¬Ëã·¨µÄÓÅÁÓ³ýÁ˺Íʱ¼ä¸´ÔÓ¶ÈÓйأ¬»¹Óë¿Õ¼ä¸´ÔÓ¶ÈÃÜÇÐÏà¹Ø¡£¶øËæ×ÅÉ豸Ӳ¼þÅäÖõIJ»¶ÏÌáÉý£¬¶ÔÖÐСÐÍÓ¦ÓóÌÐòÀ´Ëµ£¬¶ÔËã·¨µÄ¿Õ¼ä¸´ÔӶȵÄÒªÇóÒ²¿íËÉÁ˲»ÉÙ¡£²»¹ý£¬ÔÚµ±½ñ Web2.0 ʱ´ú£¬¶ÔÓ¦ÓóÌÐòµÄʱ¼ä¸´ÔÓ¶ÈÈ´ÓÐÁ˸ü¸ßµÄÒªÇó¡£
ʲôÊÇËã·¨µÄʱ¼ä¸´ÔÓ¶ÈÄØ£¿¸ÅÒªÀ´Ëµ£¬ÊÇÖ¸´ÓËã·¨ÖÐÑ¡È¡Ò»¸öÄÜ´ú±íËã·¨µÄÔ²Ù×÷£¬ÒÔÔ²Ù×÷Öظ´Ö´ÐеĴÎÊý×÷ΪËã·¨µÄʱ¼äÁ¿¶È¡£Ó°Ïìʱ¼ä¸´ÔӶȵÄÒòËØÓÐÁ½¸ö£ºÒ»ÊÇÔ²Ù×÷µÄÖ´ÐÐʱ¼ä£¬¶þÊÇÔ²Ù×÷Òò¿ØÖƽṹÒýÆðµÄÖ´ÐдÎÊý¡£Òª°ÑËã·¨µÄʱ¼ä¸´ÔӶȽµÏÂÀ´£¬½µµÍÔ²Ù×÷µÄÖ´ÐдÎÊýÊǽÏΪÈÝÒ׵ķ½·¨£¬Ò²ÊÇÖ÷Òª·½·¨¡£±¾ÎÄËù½²ÊöµÄ·½·¨£¬ÊÇͨ¹ýÇÉÓà PHP µÄÊý×飬½µµÍÔ²Ù×÷µÄÖ´ÐдÎÊý£¬´Ó¶ø´ïµ½½µµÍË㷨ʱ¼ä¸´ÔӶȵÄÐèÇ󣬺ʹó¼Ò·ÖÏí¡£
Ëã·¨µÄʱ¼äÁ¿¶È¼Ç×÷ T(n)=O(f(n))£¬Ëü±íʾËã·¨Öлù±¾²Ù×÷Öظ´Ö´ÐеĴÎÊýÊÇÎÊÌâ¹æÄ£ n µÄij¸öº¯Êý f(n)£¬Ò²¾ÍÊÇ˵Ëæ×ÅÎÊÌâ¹æÄ£ n µÄÔö´ó£¬Ëã·¨Ö´ÐÐʱ¼äµÄÔö³¤ÂÊºÍ f(n) µÄÔö³¤ÂÊÏàͬ¡£¶àÊýÇé¿öÏ£¬ÎÒÃÇ°Ñ×îÉî²ãÑ»·ÄÚµÄÓï¾ä×÷ΪԲÙ×÷À´ÌÖÂÛËã·¨µÄʱ¼ä¸´ÔӶȣ¬ÒòΪËüµÄÖ´ÐдÎÊýºÍ°üº¬ËüµÄÓï¾äµÄƵ¶ÈÏàͬ¡£Ò»°ãÇé¿öÏ£¬¶ÔÒ»¸öÎÊÌâÖ»ÐèÑ¡ÔñÒ»ÖÖ»ù±¾²Ù×÷À´ÌÖÂÛËã·¨µÄʱ¼ä¸´ÔӶȼ´¿É¡£ÓÐʱҲÐèҪͬʱ¿¼ÂǶàÖÖ»ù±¾²Ù×÷¡£
ÔÚ Web ¿ª·¢ÖУ¬Í¨³£Ò»¸ö¹¦ÄܵÄÖ´ÐÐʱ¼ä»òÏìӦʱ¼ä£¬²»½ö½ö¸ú·þÎñÆ÷µÄÏìÓ¦ÄÜÁ¦¡¢´¦ÀíÄÜÁ¦Óйأ¬»¹Éæ¼°µÚÈý·½¹¤¾ßµÄ½»»¥Ê±¼ä£¬Èç¶ÔÊý¾Ý¿âµÄÁ´½Óʱ¼äºÍ¶ÔÊý¾Ý½øÐдæÈ¡µÄʱ¼ä¡£Òò¶øÔÚÑ¡¶¨Ô²Ù×÷ÊÇ£¬ÐèÒª×ۺϿ¼ÂÇÓ¦ÓóÌÐò¸÷·½ÃæµÄÒòËØ£¬ÒÔ×î´óÓ°Ïì³ÌÐòÖ´ÐÐʱ¼äµÄ²Ù×÷ΪԲÙ×÷£¬À´ºâÁ¿Ëã·¨µÄʱ¼ä¸´ÔӶȡ£Ò²¾ÍÊÇ˵£¬ÐèÒª³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬¶ÔÖØÒª²Ù×÷µÄÖ´ÐÐʱ¼äÄÜÓлù±¾µÄÈÏʶ¡£
³£¼û³ÌÐòÖеÄʱ¼ä¸´ÔӶȷÖÎö
ÎÒÃÇÏÈ¿´Ò»¸öÀý×
Ïà¹ØÎĵµ£º
PHP 5.2 ¼°ÒÔÉÏ°æ±¾ÌṩÁË json_encode ºÍ json_decode º¯Êý£¬Ï൱ºÃÓá£
¶ø֮ǰµÄ°æ±¾ÔòÐèÒªÏÂÔØÍøÓÑÃÇ×ÔÐпª·¢µÄ¿â£¨ÓÐÐËȤµÄ¿ÉÒÔ¿´Ï http://code.itlearner.com/php/JSON-class.html £©
¿ÉÒԲο¼ÈçÏÂÕâ¸ö·½·¨À´ÔڵͰ汾ÉÏÀ©³äÕâÁ½¸öº¯Êý£º
if (!function_exists('json_encode') && !function_exists('j ......
PHP½âÒÉ
1. ´úÂëÖØÓ÷½·¨include()ºÍrequire()º¯Êý²îÒ죿
1) Require()º¯Êý
ʹÓÃrequier()°üº¬ÍⲿphpÎļþʱ£¬Ö»Òª×ÔÉíphpÎļþ±»Ö´ÐУ¬ÍⲿÎļþµÄÄÚÈݾͽ«±»°üº¬½ø¸Ã×ÔÉíphpÎļþ£¬µ±°üº¬µÄÍⲿÎļþ·¢Éú´íÎóʱ£¬ÏµÍ³½«¸ø³ö´íÎóÌáʾ£¬²¢ÇÒÍ£Ö¹phpÎļþµÄÖ´ÐС£
ʾÀý£º
µ÷ÓÃÎļþconfig.incµÄ³ÌÐò´úÂ룺
<?php ec ......
¡¡ 1¡¢ÓÃPHP´òÓ¡³öÇ°Ò»ÌìµÄʱ¼ä¸ñʽÊÇ2006-5-10 22:21:21(2·Ö)
¡¡¡¡2¡¢echo(),print(),print_r()µÄÇø±ð(3·Ö)
¡¡¡¡3¡¢Äܹ»Ê¹HTMLºÍPHP·ÖÀ뿪ʹÓõÄÄ£°å(1·Ö)
¡¡¡¡4¡¢Ê¹ÓÃÄÄЩ¹¤¾ß½øÐа汾¿ØÖÆ?(1·Ö)
¡¡¡¡5¡¢ÈçºÎʵÏÖ×Ö·û´®·×ª?(3·Ö)
¡¡¡¡--------------------------------------------------------------- ......
¾¡Á¿Ê¹Óõ¥ÒýºÅ¶ø²»ÊÇË«ÒýºÅ¡£
¾¡Á¿Ê¹ÓôøÌõ¼þµÄinclude¶ø²»ÊÇrequire¡£
¾¡Á¿Ê¹ÓÃecho¶ø²»ÊÇprint¡£
¾¡Á¿Ê¹ÓÃÄÚǶµÄHTML¶ø²»ÊÇecho¡£
¾¡Á¿Ê¹ÓÃstr£replace()¶ø²»ÊÇereg£replace()¡£
¾¡Á¿sql²»ÓÃÁªºÏ²éѯ¡£
......
Ò»Ö±¶¼ÒÔΪÔÚPHPÖУ¬' ºÍ"ÊÇûÓÐÇø±ðµÄ£¬½ñÌì¿´ÁËÖÐÔ´óѧËïÖÙÔÀÀÏʦµÄÊÓƵ½Ì³Ì£¬²Å·¢ÏÖ£¬ÕâÁ½ÕßÓ÷¨ÊÇÓÐÇø±ðµÄ£¬¾Ù¸ö¼òµ¥µÄÀý×Ó£º
1.php
<?$str='±ù¶³Óã';
echo '$str µÄ²©¿ÍµØÖ·ÊÇhttp://www.webxuexi.net' ;//×¢ÒâÕâÀïÊǵ¥ÒýºÅŶ
?>
2.php
<?
$str='±ù¶³Óã';
echo ......