I have the following json string and I want to retrieve just the email address from it. How do I do it in php?
{\"communications\":{\"communication\":[{\"@a
You could use json_decode(). Your example string there is a bit complicated for me to think about right now, but as an example of my own:
$json = '{"a":"apples","b":["bananas","boysenberries"],"c":"carrots"}'; $arr = json_decode($json); echo $arr['a']; // "apples" echo $arr['b'][0]; // "bananas"