I have this JSON
{
"code": "1",
"message": "User Created",
"data": {
"name": "Customer Name",
"email": "customer@email.com"
}
}
How do I get the name and email here using PHP?
I have this JSON
{
"code": "1",
"message": "User Created",
"data": {
"name": "Customer Name",
"email": "customer@email.com"
}
}
How do I get the name and email here using PHP?
$json_str = '{
"code": "1",
"message": "User Created",
"data": {
"name": "Customer Name",
"email": "customer@email.com"
}
}';
$arr = json_decode($json_str, true);
echo $arr['data']['name'];
echo $arr['data']['email'];