我有一个变量data
,它看起来像:
{"Name":"Username","Crew":"None","Wealth":"Billionaire","Rank":"Respectable Hitman","Status":"Alive ( Online )","Messages sent":"3","Messages received":"1"}
我想转换该对象,使其读取
Name: Username
Crew: None
Wealth: Billionaire
Rank: Respectable Hitman
Status: Alive ( Online )
Messages sent: 3
Messages received: 1
转换此内容的最佳方法是什么?
谢谢!
答案 0 :(得分:8)
标准库和模板文字可以在这里提供帮助:
$officer_id = $array[1];
$userpassword = $array[2];
答案 1 :(得分:0)
只需读取对象即可? 编辑:添加了hasOwnProperty以确保它不会得到其他不需要的值
PokerHand