[ת]PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
±¾ÎÄÖ÷ÒªÊǽéÉÜÔÚ PHP µÄ±à³ÌÖУ¬ÈçºÎÇÉÓÃÊý×éÀ´½µµÍÒò¶à²ãÑ»·¶øÒýÆðµÄʱ¼ä¸´ÔӶȵÄÎÊÌâ¡£ÌرðÊǵ±³ÌÐòÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»¥Ê±£¬Óô˷½·¨À´ÓÅ»¯ÄãµÄ´úÂ룬½«»á´ø¸øÒâÏë²»µ½µÄЧ¹û¡£
ͨ³£¿ª·¢ÈËÔ±ÔÚд³ÌÐòµÄʱºò£¬ÍùÍùÊÇ°ÑÒѾÉè¼ÆºÃ»òÕß¹¹Ë¼ºÃµÄÔËËãÂß¼£¬Ö±½ÓÓñà³ÌÓïÑÔ·Òë³öÀ´¡£³ÌÐòÄÜ˳Àû±àÒëͨ¹ý£¬ÄÇÊǺÜÁîÈ˸ßÐ˵ÄÊÂÇé¡£Èç¹û´Ëʱ³ÌÐòµÄÔËÐÐʱ¼ä»¹ÄܽÓÊÜ£¬¾Í»á³Á½þÔÚд´úÂëµÄ³É¾Í¸Ðµ±ÖУ¬³£³£ÔÚÕâ¸ö¹ý³ÌÖкöÂÔ´úÂëµÄÓÅ»¯¡£Ö»Óе±³ÌÐòÔËÐÐËÙ¶ÈÊܵ½Ó°Ïìʱ£¬²Å»Ø¹ýÍ·È¥¿¼ÂÇÓÅ»¯µÄÊÂÇé¡£
ʲôÊÇËã·¨µÄʱ¼ä¸´ÔÓ¶È
ʱ¼ä¸´ÔÓ¶ÈÊÇ¿ª·¢ÈËÔ±ÓÃÀ´ºâÁ¿Ó¦ÓóÌÐòËã·¨ÓÅÁÓµÄÖ÷ÒªÒòËØ¡£¿Í¹ÛµØ˵£¬Ëã·¨µÄÓÅÁÓ³ýÁ˺Íʱ¼ä¸´ÔÓ¶ÈÓйأ¬»¹Óë¿Õ¼ä¸´ÔÓ¶ÈÃÜÇÐÏà¹Ø¡£¶øËæ×ÅÉ豸Ӳ¼þÅäÖõIJ»¶ÏÌáÉý£¬¶ÔÖÐСÐÍÓ¦ÓóÌÐòÀ´Ëµ£¬¶ÔËã·¨µÄ¿Õ¼ä¸´ÔӶȵÄÒªÇóÒ²¿íËÉÁ˲»ÉÙ¡£²»¹ý£¬ÔÚµ±½ñ Web2.0 ʱ´ú£¬¶ÔÓ¦ÓóÌÐòµÄʱ¼ä¸´ÔÓ¶ÈÈ´ÓÐÁ˸ü¸ßµÄÒªÇó¡£
ʲôÊÇËã·¨µÄʱ¼ä¸´ÔÓ¶ÈÄØ£¿¸ÅÒªÀ´Ëµ£¬ÊÇÖ¸´ÓËã·¨ÖÐÑ¡È¡Ò»¸öÄÜ´ú±íËã·¨µÄÔ²Ù×÷£¬ÒÔÔ²Ù×÷Öظ´Ö´ÐеĴÎÊý×÷ΪËã·¨µÄʱ¼äÁ¿¶È¡£Ó°Ïìʱ¼ä¸´ÔӶȵÄÒòËØÓÐÁ½¸ö£ºÒ»ÊÇÔ²Ù×÷µÄÖ´ÐÐʱ¼ä£¬¶þÊÇÔ²Ù×÷Òò¿ØÖƽṹÒýÆðµÄÖ´ÐдÎÊý¡£Òª°ÑËã·¨µÄʱ¼ä¸´ÔӶȽµÏÂÀ´£¬½µµÍÔ²Ù×÷µÄÖ´ÐдÎÊýÊǽÏΪÈÝÒ׵ķ½·¨£¬Ò²ÊÇÖ÷Òª·½·¨¡£±¾ÎÄËù½²ÊöµÄ·½·¨£¬ÊÇͨ¹ýÇÉÓà PHP µÄÊý×飬½µµÍÔ²Ù×÷µÄÖ´ÐдÎÊý£¬´Ó¶ø´ïµ½½µµÍË㷨ʱ¼ä¸´ÔӶȵÄÐèÇ󣬺ʹó¼Ò·ÖÏí¡£
Ëã·¨µÄʱ¼äÁ¿¶È¼Ç×÷ T(n)=O(f(n))£¬Ëü±íʾËã·¨Öлù±¾²Ù×÷Öظ´Ö´ÐеĴÎÊýÊÇÎÊÌâ¹æÄ£ n µÄij¸öº¯Êý f(n)£¬Ò²¾ÍÊÇ˵Ëæ×ÅÎÊÌâ¹æÄ£ n µÄÔö´ó£¬Ëã·¨Ö´ÐÐʱ¼äµÄÔö³¤ÂÊºÍ f(n) µÄÔö³¤ÂÊÏàͬ¡£¶àÊýÇé¿öÏ£¬ÎÒÃÇ°Ñ×îÉî²ãÑ»·ÄÚµÄÓï¾ä×÷ΪԲÙ×÷À´ÌÖÂÛËã·¨µÄʱ¼ä¸´ÔӶȣ¬ÒòΪËüµÄÖ´ÐдÎÊýºÍ°üº¬ËüµÄÓï¾äµÄƵ¶ÈÏàͬ¡£Ò»°ãÇé¿öÏ£¬¶ÔÒ»¸öÎÊÌâÖ»ÐèÑ¡ÔñÒ»ÖÖ»ù±¾²Ù×÷À´ÌÖÂÛËã·¨µÄʱ¼ä¸´ÔӶȼ´¿É¡£ÓÐʱҲÐèҪͬʱ¿¼ÂǶàÖÖ»ù±¾²Ù×÷¡£
ÔÚ Web ¿ª·¢ÖУ¬Í¨³£Ò»¸ö¹¦ÄܵÄÖ´ÐÐʱ¼ä»òÏìӦʱ¼ä£¬²»½ö½ö¸ú·þÎñÆ÷µÄÏìÓ¦ÄÜÁ¦¡¢´¦ÀíÄÜÁ¦Óйأ¬»¹Éæ¼°µÚÈý·½¹¤¾ßµÄ½»»¥Ê±¼ä£¬Èç¶ÔÊý¾Ý¿âµÄÁ´½Óʱ¼äºÍ¶ÔÊý¾Ý½øÐдæÈ¡µÄʱ¼ä¡£Òò¶øÔÚÑ¡¶¨Ô²Ù×÷ÊÇ£¬ÐèÒª×ۺϿ¼ÂÇÓ¦ÓóÌÐò¸÷·½ÃæµÄÒòËØ£¬ÒÔ×î´óÓ°Ïì³ÌÐòÖ´ÐÐʱ¼äµÄ²Ù×÷ΪԲÙ×÷£¬À´ºâÁ¿Ëã·¨µÄʱ¼ä¸´ÔӶȡ£Ò²¾ÍÊÇ˵£¬ÐèÒª³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬¶ÔÖØÒª²Ù×÷µÄÖ´ÐÐʱ¼äÄÜÓлù±¾µÄÈÏʶ¡£
³£¼û³ÌÐòÖеÄʱ¼ä¸´ÔӶȷÖÎö
ÎÒÃÇÏÈ¿´Ò»¸öÀý×
Ïà¹ØÎĵµ£º
javaµÄд·¨
/**
*
* @param location
* @param nameList±£´æ½á¹ûµÄ£¡
*/
public void listDict(String location, List<String> nameList) {
File fileList = new File(location);
if (fileList.isDirectory()) {
File[] files = fileList.listFiles();
for (File f : files) {
i ......
Session¼ò½é
session ·Ö³ÉÁ½²¿·Ö£¬session¿Õ¼ä´æ·ÅÓÚ·þÎñÆ÷¶Ë£¬´ò¿ª¿Õ¼äµÄID ´æ·ÅÓÚ ¿Í»§¶ËµÄcookie£¬ Èç¹û¿Í»§¶Ë¹Ø±ÕÁËcookie£¬session¾Í²»ÄÜÕý³£µÄʹÓá£
SessionµÄÖÐÎÄÒëÃû½Ð×ö“»á»°”£¬Æä±¾À´µÄº¬ÒåÊÇÖ¸ÓÐʼÓÐÖÕµÄһϵÁж¯×÷/ÏûÏ¢£¬±ÈÈç´òµç»°Ê±´ÓÄÃÆðµç»°²¦ºÅµ½¹Ò¶Ïµç»°ÕâÖмäµÄһϵÁйý³Ì¿ÉÒÔ³Æ ......
·þÎñÆ÷±äÁ¿ $_SERVER Ïê½â£º
1¡¢$_SESSION['PHP_SELF'] -- »ñÈ¡µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû
2¡¢$_SERVER['SERVER_PROTOCOL'] -- ÇëÇóÒ³ÃæʱͨÐÅÐÒéµÄÃû³ÆºÍ°æ±¾¡£ÀýÈ磬“HTTP/1.0”¡£
3¡¢$_SERVER['REQUEST_TIME'] -- ÇëÇó¿ªÊ¼Ê±µÄʱ¼ä´Á¡£´Ó PHP 5.1.0 ÆðÓÐЧ¡£ºÍtimeº¯ÊýЧ¹ûÒ»Ñù¡£
4¡¢$_SERVER['argv'] - ......
Ò»Ö±¶¼ÒÔΪÔÚPHPÖУ¬' ºÍ"ÊÇûÓÐÇø±ðµÄ£¬½ñÌì¿´ÁËÖÐÔ´óѧËïÖÙÔÀÀÏʦµÄÊÓƵ½Ì³Ì£¬²Å·¢ÏÖ£¬ÕâÁ½ÕßÓ÷¨ÊÇÓÐÇø±ðµÄ£¬¾Ù¸ö¼òµ¥µÄÀý×Ó£º
1.php
<?$str='±ù¶³Óã';
echo '$str µÄ²©¿ÍµØÖ·ÊÇhttp://www.webxuexi.net' ;//×¢ÒâÕâÀïÊǵ¥ÒýºÅŶ
?>
2.php
<?
$str='±ù¶³Óã';
echo ......
×öPHP³ÌÐòµÄÈ˶¼ÖªµÀhtmlentitiesºÍhtmlspecialcharsº¯Êý£¬¶¼ÊǸñʽ»¯html´úÂëµÄ£¬µ«ÊÇÕâ¶þ¸öº¯ÊýÊÇ·ñÕæµÄ¹¦ÄÜÒ»ÑùÂ𣿠php³ÌÐòÔ±Ö®¼Ò ÕâÁ½¸öº¯ÊýÔÚ¸ñʽ»¯´øÓÐÓ¢ÎÄ×Ö·ûµÄhtml´úÂëµÄʱºò»ù±¾Ã»É¶ÎÊÌ⣬µ«ÊÇhtmlentities¶ÔÖÐÎÄ×Ö·ûÒ²²»·Å¹ý£¬ÕâÑùµÃ³öÀ´µÄ½á¹ûÊÇÖÐÎÄ×Ö·û²¿·Ö±äΪһ¶ÑÂÒÂë¡£µ±Ê±×öÓ¢ÎÄÕ¾µÄʱºò¸ù±¾¾Íû¾õ²ìµ ......