JSON object to php array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JSON object to php array

Hi guys , How to convert this json object to php array ? "[{\"name\":\"andy\",\"age\":259,\"count\":1},{\"name\":\"bill\",\"age\":299,\"count\":5},{\"name\":\"john\",\"age\":499,\"count\":4}]"

7th Jan 2023, 7:52 PM
Boby Dillan
3 Answers
0
use json_decode()
7th Jan 2023, 8:10 PM
NinjaGamer
NinjaGamer - avatar
0
$array = json_decode($json, true); print_r($array);
7th Jan 2023, 9:07 PM
Aditya Dixit
0
Ok , thanks guys
19th Jan 2023, 5:07 PM
Boby Dillan