本文实例讲述了PHP实现数组转JSon和JSon转数组的方法。分享给大家供大家参考,具体如下:
数组转JSon数据:
运行结果:
Array
(
[menber] => Array
(
[aa] => Array
(
[username] => ericwolf
[age] => 25
)
[bb] => Array
(
[username] => eeee
[age] => 22
)
)
)
string(32) "{"username":"ericwolf","age":25}"
string(84) "{"menber":{"aa":{"username":"ericwolf","age":25},"bb":{"username":"eeee","age":22}}}"
JSon转数组,并打印:
运行结果:
key=value
key1=value1
新闻热点
疑难解答
图片精选