I'm executing a curl request using php:
//Initiate cURL. $ch = curl_init($url); //Encode the array into JSON. $jsonDataEncoded = json_encode($data); //Tell cURL that we want to send a POST request. curl_setopt($ch, CURLOPT_POST, 1); //Attach our encoded JSON string to the POST fields. curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded); //Set the content type to application/json curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); //Execute the request $result = curl_exec($ch); The browser returns:
{"success":"true","lead_id":"141872","code":201} OR {"error":true,"duplicate":true,"message":"Duplicate: This has already been submitted to the API.","code":400} How do I access the data in $result it current only returns 1