$stooges = array('Moe','Larry','Curly')
$new = serialize($stooges)
print_r($new)echo "<br />"
print_r(unserialize($new))
结果:a:3:{i:0s:3:"Moe"i:1s:5:"Larry"i:2s:5:"Curly"}
Array ( [0] =>Moe [1] =>Larry [2] =>Curly )
$result = mysql_query("SELECT * FROM table")$data = array()
while($rs = mysql_fetch_assoc($result)){
$data[] = $rs
}
print_r($data)//$data就是数组了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)