gb2312的php檔案轉換為utf-8格式後的一個錯誤

來源:互聯網
上載者:User

簡介:這是gb2312的php檔案轉換為utf-8格式後的一個錯誤的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=324443' scrolling='no'>

GB2312的php檔案轉換為UTF-8格式後,php程式運行時就會出現header已發送這樣的錯誤提示(試圖開啟session的時候)。

錯誤如下:
代碼:

Warning: Cannot modify header information - headers already sent by (output started at /home/yoyo/public_html/blog/index.php:1) in /home/yoyo/public_html/blog/global.php on line 11
?
Warning: Cannot modify header information - headers already sent by (output started at /home/yoyo/public_html/blog/index.php:1) in /home/yoyo/public_html/blog/global.php on line 35

這樣的錯誤通常是在開啟session之前頁面已經有輸出時出現,在IE下面看,並沒有輸出,可是在firefox下面看,在正式頁面輸出前,有一個位元組的亂碼。這個亂碼就是造成錯誤的原因(它在session之前就輸出了)。

解決的方法:找到你有出錯提示的檔案,下載下來,用編輯器(推薦用最新版的editplus)開啟,拷貝代碼,刪除這個檔案,重建一個新檔案,複製剛才的代碼進去,存檔案的時候,一定要存成UTF-8的,上傳覆蓋原檔案,應該就好了。

“gb2312的php檔案轉換為utf-8格式後的一個錯誤”的更多相關文章 》

愛J2EE關注Java邁克爾傑克遜視頻站JSON線上工具

http://biancheng.dnbcw.info/php/324443.html pageNo:14

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.