I am not able to convert magento 2 JSON response into array. Can you please help in short out this problem?
Here is my code:
$url = 'http://example.com/api/coop';
$post = [
'firstname' => $userDetail->firstname,
'lastname' => $userDetail->lastname,
'email' => $userDetail->email,
'password' => $userDetail->password
];
$this->curlClient->post($url, $post);
$responseCurl = $this->curlClient->getBody();
print_r($responseCurl);
die();
Output:
{"coop_id":"COOP33"}
I have to use coop_id
value somewhere in my logic. Thanks in advance.