【问题标题】:Decode JSON result stdClass Object() to a formatted HTML将 JSON 结果 stdClass Object() 解码为格式化的 HTML
【发布时间】:2012-06-08 20:35:56
【问题描述】:

如何将 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 html json stdclass


    【解决方案1】:

    无论你在哪里解码 php 中的 json,而不是那个使用

    json_decode($json,true)
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-19
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多