<?php
header('Content-Type: text/html; charset=utf-8');

$str = array
(
'a' => 'aa',
'b' => 'bb',
'c' => array
(
0 => 1,
1 => 2,
2 => 34,
3 => 4,
),
);
//把數組轉化成字符串,可以進行直接存儲到數據庫中
$s = serialize($str);
echo $s;
//從字符串中還原回數組
$str = unserialize($s);
print_r($str);
?>

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()