I'm trying to pull a json file of products from a URL in PHP. I have the following code but it's not working. Can somebody please advise where I've gone wrong?
function getJson() {
$request = file_get_contents('https://3rdParty.guntrader.uk/ShootingSuppliesLtd/jsonGuns');
$json = json_decode($request);
return $json;
};
echo $json;
Undefined variable: json in C:\Users\darry\dev\VVV\www\ssheadless\importJson.php on line 36