I'm doing a query with CURL in PHP
$handler = curl_init("https://doffice.dexcar.de/api/AdvisorProfile/15ef1274-6ff5-4b3c-87bd-02f9f103fdb9");
curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($handler);
curl_close($handler);
$response = substr($response, 0, -1);
$response = str_replace("\"", "'", $response);
print_r(json_decode($response));
That query returns a json
which I convert to an PHP array with json_decode()
, but it does not convert it because it returns the json
in this way
[{"Id":"15ef1274-6ff5-4b3c-87bd-02f9f103fdb9","Name":"Livio PEDRON","Nickname":"THE_BOSS","Photo":null,"City":"RIVOLI","Address":{"Street":"via Ivrea, 14/E","Zip":"10098","Country":{"Code":"IT","Name":"Italy"}},"Level":"Advisor","Email":"[email protected]","Phone":"+39 335 5206976","Rating":0.0,"Zone":"TORINO"}]
The idea is to convert the double quote ( "
) into a single quote ( '
) but for some reason, it does not.