How to loop and extract record from nested json array with php | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to loop and extract record from nested json array with php

Im stuck... I have a multipe nested Arrays in json Format. I need to loop throug those and assign the values to variables based on used Input - i must found with which Array Matches the user Input. I try a foreeach loop but I do it wrong… I coulds find an answer also here. Here is my Code. https://code.sololearn.com/wFW1d5m3TGqY/?ref=app

7th Apr 2020, 9:00 PM
pap
pap - avatar
2 Answers
+ 1
pap , change in the second foreach loop $arr to $array.
7th Apr 2020, 9:17 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
TheWh¡teCat 🇧🇬 thanks! have you any idea how to solve the second part of the question? now it loops right, but to check if the userd input ($kur = „kk“) is in anny of the arrays and to echo only this array?
8th Apr 2020, 7:21 AM
pap
pap - avatar