I have set up a curl to return some values however i'm unsure how to retrieve child values. When i try to retrieve $bankname it's empty because its a child value i believe.
$bin = "492182";
$url = "https://lookup.binlist.net/" . $bin;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($ch);
curl_close($ch);
$details = json_decode($resp, true);
$cardscheme = strtoupper($details['scheme']);
$cardtype = ucwords($details['type']);
$cardbrand = ucwords($details['brand']);
$bankname = strtoupper($details['bank']); //<<< need this value
Below is the api:
curl / https
curl -H "Accept-Version: 3" "https://lookup.binlist.net/45717360"
{
"number": {
"length": 16,
"luhn": true
},
"scheme": "visa",
"type": "debit",
"brand": "Visa/Dankort",
"prepaid": false,
"country": {
"numeric": "208",
"alpha2": "DK",
"name": "Denmark",
"emoji": "🇩🇰",
"currency": "DKK",
"latitude": 56,
"longitude": 10
},
"bank": {
"name": "Jyske Bank",
"url": "www.jyskebank.dk",
"phone": "+4589893300",
"city": "Hjørring"
}
}
Any help appreciated!