I am trying to parse a JSON response from a server to a array, but it won't work.
I am using:
json_decode($string,true);
So that must not be the problem.
This is the code where I ask the server:
$curl_header = array();
$curl_header[] = "Authorization: Basic ".base64_encode("$auth_code:");
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $curl_header);
curl_setopt($curl, CURLOPT_URL, 'https://api.kassacompleet.nl/v1/ideal/issuers/');
$result = curl_exec($curl);
curl_close($curl);
// Handle and store result
$test = json_decode($result, true);
print_r($test);
This is the response i get from the server and after printing it:
[ { "id": "INGBNL2A", "list_type": "Nederland", "name": "Issuer Simulation V3 - ING" }, { "id": "RABONL2U", "list_type": "Nederland", "name": "Issuer Simulation V3 - RABO" } ]1
Also this strange nr 1 appears on the end of the string after i print it.
Does someone have any tips for me ?