title: Trying to pull json from URL, not working
body: <p>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?</p>
  
  <pre><code>function getJson() {
  $request = file_get_contents('https://3rdParty.guntrader.uk/ShootingSuppliesLtd/jsonGuns');
  $json = json_decode($request);
  return $json;
  };
  
  echo $json;
  </code></pre>
  
  <p>Undefined variable: json in C:\Users\darry\dev\VVV\www\ssheadless\importJson.php on line 36</p>