$json = ' { "type": "donut", "name": "Cake" }'; $yummy = json_decode($json); echo $yummy->type; //donut