ÔÚ±aдPHPÎļþ¹ý³ÌÖУ¬*¢ÏÖÔÚa¯ÀÀÆ÷Ô¤ÀÀPHPÎļþʱ£¬¶¥²¿»a³oÏÖÒ»Ðпհף¬Ó°ÏiÁËÒ³ÃaeµÄ²¼¾Ö¡£
¹ØÓÚBOM headerµÄ½aÊÍÈçÏ£º
ͨ³£Çe¿oÏ£¬Ê¹ÓÃWindowsϵͳ×Ô´øµÄ¼Çʱ¾³ÌÐo±aдÍøÒ³³ÌÐo£¬µ«ÔÚ±aд»oÐÞ¸Äphp²(C)¿Íϵͳ´uÂeºo£¬½øÐе÷ÊÔʱ×ÜÊÇ»a³oÏÖÈçͬÒÔϼ¸µaÎÊÌa£º
¨C²»ÄܵÇÈe»oÕß²»Äܵdzo£»
¨CÒ³¶¥³oÏÖÒ»Ìo¿Õ°×£»
¨CÒ³¶¥³oÏÖ´iÎo¾¯¸ae£»
¨CÆaËu²»Õý³£µÄÇe¿o¡£
*ÖÎoÔÒo£º
ÓÉÓÚʹÓÃUTF-8±aÂe£¬ÔÚ±aд»oÐ޸ĴuÂeºo¶¼±£´aeΪutf-8±aÂe¸ñʽ¡£ËaÈ»ÏÖÔÚ¼¸ºoËuÓеÄÎı¾±a¼Èi¼þ¶¼¿ÉÒÔÏÔʾ²¢±a¼UTF-8±aÂeµÄÎļþ£¬µ«ÊǺÜÒź¶µÄÊÇÆaÖкܶaÈi¼þµÄ±iÏÖ²¢²»ÀiÏe¡£
Àa ËÆWINDOWS×Ô´øµÄ¼Çʱ¾µÈÈi¼þ£¬ÔÚ±£´aeÒ»¸oÒÔUTF-8±aÂeµÄÎļþʱ£¬»aÔÚÎļþ¿ªÊ¼µÄµØ½²aÈeÈý¸o²»¿É¼uµÄ×Öu£¨_0xEF _0xBB _0xBF£¬¼´BOM¡ª¡ªByte Order Mark£(C)¡£ËuÊÇÒ»´®Òþ²ØµÄ×Öu£¬ÓÃÓÚÈüÇʱ¾µÈ±a¼Æ÷ʶ±ðÕa¸oÎļþÊÇñÒÔUTF-8±aÂe¡£¶ÔÓÚÒ»°aµÄÎļþ£¬ÕaÑu²¢²»»a²uÉuʲôÂe³¡£µ«¶ÔÓÚ PHPÀ´Ëµ£¬PHPÔÚÉe¼Æʱ¾ÍûÓп¼ÂÇBOMµÄÎÊÌa£¬²»»aºoÂÔUTF-8±aÂeµÄÎļþ¿ªÍBOMµÄÄÇÈý¸o×Öu£¬»a°ÑBOM×÷Ϊ¸ÃÎļþ¿ªÍÕýÎĵÄÒ»²¿Ö¡£ÓÉÓÚ±ØÐeÔÚ<?»oÕß<?phpºoÃaeµÄ´uÂe²Å»a×÷ΪPHP´uÂeÖ´ÐУ¬ËuÒÔ½«»aÔi³ÉÔÚÒ³ÃaeÉÏÊa³oÕaÈý¸o×Öu£¬ÏÔʾЧ¹u¾ÍÒª¿´a¯ÀÀÆ÷ÁË£¬Ò»°aÊÇÒ»¸o¿ÕÐлoÊÇÒ»¸oÂÒÂe¡£ÓÉÓÚÔÚhtmlÒ»¿ªÍÓÐÕa3¸o×ÖuµÄ´aeÔÚ£¬¼´Ê¹Ò³ÃaeµÄ top padding ÉeÖÃΪ0£¬Ò²ÎÞ¨ÈÃÕu¸oÍøÒ³½oÌua¯ÀÀÆ÷¶¥²¿¡£ÓÉÓÚÊÜCOOKIEËͳo»uÖƵÄÏÞÖÆ£¬ÔÚÕaÐ(C)Îļþ¿ªÍÒѾÓÐBOMµÄÎļþÖУ¬COOKIEÎÞ¨Ëͳo£¨ÒoΪÔÚ COOKIEËͳoÇ°PHPÒѾËͳoÁËÎļþÍ£(C)£¬ËuÒÔµÇÈeºÍµÇ³o¹¦ÄÜʧЧ¡£Ò»ÇÐÒÀÀµCOOKIE¡¢SESSIONʵÏֵŦÄÜÈ«²¿ÎÞЧ¡£
*½a¾o°i¨**£º
ÔÚ±a¼¡¢¸u¸ÄÈκÎÎı¾Îļþʱ£¬ÇeÎñ±ØʹÓò»»aÂÒ¼ÓBOMµÄ±a¼Æ÷¡£Linuxϵıa¼Æ÷Ó¦¸Ã¶¼Ã»ÓÐÕa¸oÎÊÌa¡£WINDOWSÏ£¬ÇeÎðʹÓüÇʱ¾µÈ±a¼Æ÷¡£ÍƼoµÄ±a¼Æ÷ÊÇ£º
Editplus 2.12°ae±¾ÒÔÉÏ£»
EmEditor£»
UltraEdit£¨ÐeҪȡÏu¡®Ìi¼ÓBOM'µÄÏa¹ØÑ¡Ïi£(C)£»
Dreamweaver£¨ÐeҪȡÏu¡®Ìi¼ÓBOM'µÄÏa¹ØÑ¡Ïi£(C)£»
Notepad(ÐeÒª½øÐС°×ª»»Îª²»´øBOMµÄUTF-8¡±)µÈ¡£
¶ÔÓÚÒѾÌi¼ÓÁËBOMµÄÎļþ£¬ÒªÈ¡ÏuµÄ»°£¬¿ÉÒÔÓÃÒÔÉϱa¼Æ÷Ái´aeÒ»´Î¡££¨EditplusÐeÒªÏÈÁi´aeΪgb£¬ÔÙÁi´aeΪUTF-8¡£DreamweaverÔÚ¡±Ò³ÃaeÊoÐÔ¡°µÄ ¡°°uº¬Unicode Ç(C)Ãu£¨BOM£(C)¡±È¡Ïu¼´¿É£(C)