PHP V5ǨÒÆÖ¸ÄÏ
¡¡¡¡if ( $ec[''error''] != 0 ) return $ec[''error'']; ¡¡} ¡¡fclose( $fh ); ¡¡return 0; } $e = readConfig( ''myconfig.txt'' ); if ( $e != 0 ) ¡¡echo( "There was an error (".$e.")\n" ); ?> Õâ¶Î±ê×¼µÄÎļþ I/O ´úÂ뽫¶ÁÈ¡Ò»¸öÎļþ£¬¼ìË÷һЩÊý¾Ý£¬²¢ÔÚÓöµ½ÈκδíÎóʱ·µ»Ø´íÎó´úÂë¡£¶ÔÓÚÕâ¸ö½Å±¾£¬ÎÒÓÐÁ½¸öÎÊÌâ¡£µÚÒ»¸öÊÇ´íÎó´úÂë¡£ÕâЩ´íÎó´úÂëµÄº¬ÒåÊÇʲô£¿ÒªÕÒ³öÕâЩ´íÎó´úÂëµÄº¬Ò壬Ôò±ØÐë´´½¨ÁíÒ»¸öϵͳ½«ÕâЩ´íÎó´úÂëÓ³Éäµ½Óк¬ÒåµÄ×Ö·û´®ÖС£µÚ¶þ¸öÎÊÌâÊÇ parseLine µÄ·µ»Ø½á¹ûÊ®·Ö¸´ÔÓ¡£ÎÒÖ»ÐèÒªËü·µ»ØÊý¾Ý£¬µ«Ëüʵ¼ÊÉϱØÐë·µ»Ø´íÎó´úÂë ºÍ Êý¾Ý¡£´ó¶àÊý¹¤³Ìʦ £¨°üÀ¨ÎÒ±¾ÈËÔÚÄÚ£© ¾³£ÍµÀÁ£¬½ö·µ»ØÊý¾Ý£¬¶øºöÂÔµô´íÎó£¬ÒòΪ´íÎóºÜÄѹÜÀí¡£ Çåµ¥ 13 ÏÔʾÁËʹÓÃÒ쳣ʱ´úÂëµÄÇåÎú³Ì¶È¡£ Çåµ¥ 13. file.php5
ÎÒÎÞÐ迼ÂÇ´íÎó´úÂëÎÊÌ⣬ÒòΪÒì³£Öаüº¬ÁË´íÎóµÄ˵Ã÷ÐÔÎÄ×Ö¡£ÎÒÒ²ÎÞÐ迼ÂÇÈçºÎ×·×Ù´Ó parseLine ·µ»ØµÄ´íÎó´úÂ룬ÒòΪÈç¹û³öÏÖ´íÎ󣬸ú¯Êý½«Ö»Å׳öÒ»¸ö´íÎ󡣶ÑÕ»½«ÑÓÉìÖÁ×î½üµÄ try/catch ¿é£¬¸Ã¿éλÓڽű¾µÄµ×²¿¡£ Òì³£»úÖƽ«³¹µ×¸Ä±ä±àд´úÂëµÄ·½·¨¡£Äú²»±Ø¹ÜÀíÈÃÈËÍ·Í´µÄ´íÎó´úÂëºÍÓ³É䣬¿ÉÒÔ½«¾«Á¦¼¯ÖÐÔÚÒª´¦ÀíµÄ´íÎóÉÏ¡£ÕâÑùµÄ´úÂë¸üÒ×ÓÚÔĶÁ¡¢Î¬»¤£¬¶øÇÒÎÒҪ˵£¬ÉõÖÁÒª¹ÄÀøÄúÌí¼Ó´íÎó´¦Àí»úÖÆ£¬Ëüͨ³£¶¼ÄÜ´øÀ´ºÃ´¦¡£ ½áÊøÓï еÄÃæÏò¶ÔÏóÌØÐÔºÍÒì³£´¦ÀíµÄÔö¼ÓΪ½«´úÂë´Ó PHP V4 ǨÒƵ½ PHP V5 ÌṩÁËÇ¿ÓÐÁ¦µÄÀíÓÉ¡£ÕýÈçÄúËù¼û£¬Éý¼¶¹ý³Ì²¢²»ÄÑ¡£À©Õ¹µ½ PHP V5 µÄÓï·¨¸Ð¾õ¾ÍÏñ PHP Ò»Ñù¡£Êǵģ¬ÕâЩÓï·¨À´×ÔÖîÈç Ruby Ö®ÀàµÄÓïÑÔ£¬µ«ÎÒÈÏΪËüÃÇÅäºÏµÃ·Ç³£ºÃ¡£²¢ÇÒÕâЩÓïÑÔ½« PHP µÄ·¶Î§´ÓÒ»ÖÖÓÃÓÚСÐÍÕ¾µãµÄ½Å±¾ÓïÑÔÀ©Õ¹Îª¿ÉÓÃÓÚÍê³ÉÆóÒµ¼¶Ó¦ÓõÄÓïÑÔ¡£ |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»! |