変換前
array(6) { [0]=> array(2) { ["id"]=> int(101) ["name"]=> string(6) "ネコ" } [1]=> array(2) { ["id"]=> int(102) ["name"]=> string(9) "ネズミ" } [2]=> array(2) { ["id"]=> int(103) ["name"]=> string(6) "ウシ" } [3]=> array(2) { ["id"]=> int(104) ["name"]=> string(6) "トラ" } [4]=> array(2) { ["id"]=> int(105) ["name"]=> string(3) "鵜" } [5]=> array(2) { ["id"]=> int(106) ["name"]=> string(3) "猿" } }変換後:文字列=serialize(配列)
a:6:{i:0;a:2:{s:2:"id";i:101;s:4:"name";s:6:"ネコ";}i:1;a:2:{s:2:"id";i:102;s:4:"name";s:9:"ネズミ";}i:2;a:2:{s:2:"id";i:103;s:4:"name";s:6:"ウシ";}i:3;a:2:{s:2:"id";i:104;s:4:"name";s:6:"トラ";}i:4;a:2:{s:2:"id";i:105;s:4:"name";s:3:"鵜";}i:5;a:2:{s:2:"id";i:106;s:4:"name";s:3:"猿";}}unserializeで元に戻す。:配列=unserialize(文字列)
array(6) { [0]=> array(2) { ["id"]=> int(101) ["name"]=> string(6) "ネコ" } [1]=> array(2) { ["id"]=> int(102) ["name"]=> string(9) "ネズミ" } [2]=> array(2) { ["id"]=> int(103) ["name"]=> string(6) "ウシ" } [3]=> array(2) { ["id"]=> int(104) ["name"]=> string(6) "トラ" } [4]=> array(2) { ["id"]=> int(105) ["name"]=> string(3) "鵜" } [5]=> array(2) { ["id"]=> int(106) ["name"]=> string(3) "猿" } }