幾個實用的CSS資料 :)
很酷的wordpress theme
作者仿 Un*x的Command line操作界面設計的wordpress theme,輸入help或問號可以查詢使用方法,例如ls指令可以列出文章列表,再輸入編號即可閱讀該篇文章,輸入comment還可以寫回應。
網站:http://blog.elinc.ca/rodcli/
如果裝在我自己的blog上大概會嚇跑一堆使用者,但真的很酷! :)
Fibonacci數列
前不久在Yahoo知識家看到有人在問怎麼樣用Flash做出Fibonacci數列的效果,發現其實用陣列配合迴圈就可以完成了:
1 2 3 4 5 6 7 8 9 10 11 12 | |
PHP在unicode時出現亂碼
自己最近在試PHP的時候,發現當include一個unicode的檔案進來,會出現下列錯誤:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at E:\www\v3\ortho\classes\GlobalSettings.php:1) in E:\www\v3\ortho\classes\GlobalSettings.php on line 2
Warning: Cannot modify header information – headers already sent by (output started at E:\www\v3\ortho\classes\GlobalSettings.php:1) in E:\www\v3\ortho\classes\GlobalSettings.php on line 3
環境:Appserv on Windows 2000
我試著用記事本把被include的那個檔案另存成UTF-8,還是出現一樣的問題。找了一下資料,似乎是一個叫做BOM(Byte Order Mark)的問題。網路上發現有一些文章可以參考:
解決方法
我發現有個免費又不錯用的unicode editor叫做 EmEditor ,它可以在存成UTF-8格式時,不把BOM加上去,這樣程式執行起來就正常了 :)
PHP OOP
最近拿PHP來玩OOP(Object-Oriented Programming),發現這還挺有趣的 :)
建立類別
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
類別實體化
1 2 3 4 5 | |
它應該在頁面上會輸出:
My Name is eddie, and I’m 20 years old!
我用的是php4的版本,所以跟5的版本應該會有些不同,至少Contrustor的方法就不太一樣了