【PHP】数组与JSON互转
数组 转 JSON
<?php $arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); echo json_encode($arr); ?>
JSON 转 数组
<?php $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; echo json_decode($json, true); ?>
本文为翻滚的胖子原创文章,转载无需和我联系,但请注明来自猿教程iskeys.com