一個數組要入庫,發現不可以,特定用函數轉為字符串入庫
$data = array( 'http://img4.bitautoimg.com/autoalbum/files/20110420/734/22494073435215_1565563_15.jpg', 'http://img4.bitautoimg.com/autoalbum/files/20110420/718/22494071876770_1565547_15.jpg', 'http://img2.bitautoimg.com/autoalbum/files/20110420/671/22494067187672_1565545_15.jpg' );
用“,”分割,並轉為字符串
$data = array( 'http://img4.bitautoimg.com/autoalbum/files/20110420/734/22494073435215_1565563_15.jpg', 'http://img4.bitautoimg.com/autoalbum/files/20110420/718/22494071876770_1565547_15.jpg', 'http://img2.bitautoimg.com/autoalbum/files/20110420/671/22494067187672_1565545_15.jpg' ); $data = implode(",",$data);
轉換後的data效果:
http://img4.bitautoimg.com/autoalbum/files/20110420/734/22494073435215_1565563_15.jpg,http://img4.bitautoimg.com/autoalbum/files/20110420/718/22494071876770_1565547_15.jpg,http://img2.bitautoimg.com/autoalbum/files/20110420/671/22494067187672_1565545_15.jpg
把字符串按照分隔符切割出來使用:
$newdata = explode(",",$data);