顯示具有 PHP 標籤的文章。 顯示所有文章
顯示具有 PHP 標籤的文章。 顯示所有文章

2010-11-27

PHP UTF-8 編碼與 session 及 header 問題 (Solving BOM of UTF-8 File Encoding problem with PHP session and header)

網絡上不少跨語言網頁大部分都是以 UTF-8 作為編碼
但利用 UTF-8 編碼編寫 PHP 文件使用到 session 及 header 時便會發生問題
UTF-8 編碼的文件會在文件檔頭加上 3個bytes 的資料,這 3個bytes 稱為 BOM - Byte Order Mark
在標準制式下 UTF-8 的這 3個bytes 分別是:
第一個byte - 0xef
第二個byte - 0xbb
第三個byte - 0xbf
UTF-8 is a popular File Encoding on the internet.
However, when we use UTF-8 with PHP using session and header there are some error occurs.
UTF-8 file has 3 bytes of data at the beginning of file, this 3 bytes called BOM - Byte Order Mark
The standard of UTF-8 file of this 3 bytes is:
1st byte - 0xef
2nd byte - 0xbb
3rd byte - 0xbf

2010-10-18

利用 PEAR 製作 Excel 檔案 (Use PEAR to create an Excel file)

PEAR 為 PHP Extension and Application Repository 的簡稱
是一種以 PHP 物件導向的設計的程式庫
PEAR is the abbreviation of PHP Extension and Application Repository

2010-03-17

於 Ubuntu 手動安裝 PHP (Manuel install the PHP in Ubuntu)

安裝 PHP 前建議先安裝 Apache HTTP Server、MySQL Database 及 libxml2
You need to install Apache HTTP Server, MySQL Database and libxml2 before install PHP

libxml2 可以在 Google 等搜尋器上找到
(2-2.7.7 是 2010-03-17 最新版本)
You can find libxml2 with Google search
(2-2.7.7 is the latest version on 2010-03-17)