اريد استدعاء رمز البلد الذي هو CA

{"data":{"range":[2763128832,2763194367],"country":"CA","region":"","eu":"0","timezone":"America/Toronto","city":"","ll":[43.6319,-79.3716],"metro":0,"area":1000}}

هذا كود ال php الذي عملته

<?php

function grabIpInfo($ip)

{

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, "

" . $ip);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

$returnData = curl_exec($curl);

curl_close($curl);

return $returnData;

}

$ipInfo = grabIpInfo($_SERVER["REMOTE_ADDR"]);

$ipJsonInfo = json_decode($ipInfo);

echo $ipJsonInfo->country;

?>