繁体   English   中英

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

[英]Decode JSON result stdClass Object() to a formatted HTML

如何将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. 
)

无论您在php中解码json的何处,都可以使用

json_decode($json,true)

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM