title: GET info from external API/URL using PHP
body: <p>I have the URL <a href="http://api.minetools.eu/ping/play.desnia.net/25565" rel="noreferrer">http://api.minetools.eu/ping/play.desnia.net/25565</a> which outputs statistics of my server.</p>
  
  <p>For example:</p>
  
  <pre><code>{
    "description": "A Minecraft Server",
    "favicon": null,
    "latency": 64.646,
    "players": {
      "max": 20,
      "online": 0,
      "sample": []
    },
    "version": {
      "name": "Spigot 1.8.8",
      "protocol": 47
    }
  }
  </code></pre>
  
  <p>I want to get the value of online player count to display it on my website as: Online Players: online amount</p>
  
  <p>Can anyone help?</p>
  
  <p>I tried to do: </p>
  
  <pre><code>&lt;b&gt; Online players: 
  
  &lt;?php
  $content = file_get_contents("http://api.minetools.eu/ping/play.desnia.net/25565");
  echo ($content, ["online"]);
  }
  ?&gt;
  &lt;/b&gt;
  </code></pre>
  
  <p>But it didn't work.</p>