当前位置: 动力学知识库 > 问答 > 编程问答 >

arrays - How to get json element's property from Entire Json in PHP

问题描述:

My json value looks like this:

[{"Id":"1169"},{"Id":"1164"},{"Id":"1163"},{"Id":"1162"},{"Id":"1161"}]

Now i want to store only numeric values 1169,1164,1163,1162,1161 into different array.How can i do this?

网友答案:

Simple

    $values = array_values(json_decode($json,true));
网友答案:

its not array its a json.

You can change from array to json and json to array.

$a = json_encode($yourArray);

AND

$b= json_decode($yourJson);
分享给朋友:
您可能感兴趣的文章:
随机阅读: