謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Monday, July 23, 2012
[PHP] 如何將陣列(array)寫入資料庫(MySQL)
最簡單是用implode、explode去做字串轉換,但是,可能會發生分割符號重複的問題,所以,可以改用以下方式...
$str = base64_encode(serialize($arr)); //陣列轉字串
$arr = unserialize(base64_decode($str)); //字串轉陣列
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment