0
I am integrating an email service with Curl and PHP and would like to pick up the answer that comes in this format:
{
"id": 8
}
How do I get the field number ID
with PHP?
0
I am integrating an email service with Curl and PHP and would like to pick up the answer that comes in this format:
{
"id": 8
}
How do I get the field number ID
with PHP?
1
As you did not put your code, I will briefly illustrate here a possible solution
$response = curl_exec($ch);
$retorno = json_decode($response, true)
echo $response["id"];
Thanks, just as soon as you solved!
Browser other questions tagged php curl
You are not signed in. Login or sign up in order to post.
Gives a "var_dump()" in the returned value and checks whether it is an object or an array. If it is array, you will use $return["id"], if it is object, you will use $return->id
– Leandro Castro