我需要转换数组中的输出值
我有这个输出
{ "ID":"5454126" ,"class":"ObjectClassRAJ" }
我只需要输入ID“ 5454126”,我该怎么办?
谢谢
答案 0 :(得分:4)
答案 1 :(得分:0)
尝试json_decode:
<?php
$string = '{ "ID":"5454126" ,"class":"ObjectClassRAJ" }';
$obj = json_decode($string);
print_r($obj);
echo "<br>ID: ".$obj->ID;
echo "<br>class: ".$obj->class;
?>