How to sort the json data?

Good evening, please tell me how to do so through the json and output it to a table
json which are:
(id:["name","pice",count,"img"])
{"1":["Kamen","70",3,"https://pp.userapi.com/h4lA7G5ribk.jpg"],"5":["Coren","50",1,"https://pp.userapi.com/1Rifl45VJ60.jpg"]}

I transformed into an array for convenience
Left:
Array
(
 [1] => Array
(
 [0] => Stone
 [1] => 70
 [2] => 3
 [3] => https://pp.userapi.com/h4lA7G5ribk.jpg
)

 [5] => Array
(
 [0] => Root
 [1] => 50
 [2] => 1
 [3] => https://pp.userapi.com/1Rifl45VJ60.jpg
)

)

How do I get the id so I could then request the desired information on the go and be sure to count inside each array??
March 23rd 20 at 18:42
1 answer
March 23rd 20 at 18:44
Solution
If you honestly do not understand your problem, it seems to be all clearly visible, and what exactly the problem is not clear.
$array[0][2], where $array is your transformed array [0] is your id, [2] is your count
To build the table is enough to loop through your array.
How to call the function I know I don't know how to handle an array, so I turns out that [1] and [5] is the ides that I need and in these arrays which I need, but I need to get ID and count and I don't know how to implement it that I could then make a table just like I don't understand how can I process the array to get what you need
ID | Number | Picture
id: 1 count:3 img:https://pp.userapi.com/h4lA7G5ribk.jpg
id: 5 count:1 img:https://pp.userapi.com/1Rifl45VJ60.jpg - shawn_Hudson59 commented on March 23rd 20 at 18:47
@shawn_Hudson59,
foreach ($array as $key => $value) {
 echo "id: ".$key." count:".$value[2]." img:".$value[3]."<br>";
}
- joseph.Lowe commented on March 23rd 20 at 18:50
@joseph.Lowe, Thank You - shawn_Hudson59 commented on March 23rd 20 at 18:53

Find more questions by tags PHP