将JSON结果stdClass Object()解码为格式化的HTML

时间:2012-06-04 19:15:08

标签: php html json stdclass

如何将JSON解码为html列表,并且能够将其变为“div”或DOM元素,或者我是否遗漏了某些内容?

stdClass Object ( 
[msc] => 26771010150 
[number] => 2677410930 
[status] => OK 
[msc_mcc] => 652 
[imsi] => 652010151221139 
[mcc] => 652 
[operator_country] => Botswana 
[msc_operator_name] => Mascom Wireless (Pty) Ltd. 
[msc_operator_country] => Botswana 
[msc_mnc] => 01 [mnc] => 01 
[id] => 928692391 
[msc_location] => 
[operator_name] => Mascom Wireless (Pty) Ltd. 
)

1 个答案:

答案 0 :(得分:3)

无论你在php中解码json,而不是使用

json_decode($json,true)

它将返回您可以在html中轻松使用的关联数组。

相关问题