title: Get a single item from JSON in PHP
body: <p>I've seaching stack overflow and did not find what I`m trying to do ...
  So here is the question:
  <strong>HOW TO RETURN STEAMID ONLY?</strong></p>
  <p>CODE:</p>
  <pre><code>&lt;?php
  // define variables and set to empty values
  $steamID = &quot;&quot;;
  if ($_SERVER[&quot;REQUEST_METHOD&quot;] == &quot;POST&quot;) {
    $steamID = test_input($_POST[&quot;steamID&quot;]);
  }
  function test_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
  }
  $keyApp = '5DE00EE4D07BA728EDAB0B3C2961AA6B';
  $api = &quot;&quot;;
  $json_data = file_get_contents(&quot;http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$keyApp&amp;steamids=$steamID&quot;);
  $array = json_decode($json_data, true);
  var_dump($array);
  ?&gt;
  </code></pre>
  <p>var_dump:</p>
  <pre><code>array(1) {
    [&quot;response&quot;]=&gt;
    array(1) {
      [&quot;players&quot;]=&gt;
      array(1) {
        [0]=&gt;
        array(19) {
          [&quot;steamid&quot;]=&gt;
          string(17) &quot;76561198058543756&quot;
          [&quot;communityvisibilitystate&quot;]=&gt;
          int(3)
          [&quot;profilestate&quot;]=&gt;
          int(1)
          [&quot;personaname&quot;]=&gt;
          string(12) &quot;&quot;Cientistas&quot;&quot;
          [&quot;commentpermission&quot;]=&gt;
          int(1)
          [&quot;profileurl&quot;]=&gt;
          string(37) &quot;https://steamcommunity.com/id/rhatto/&quot;
          [&quot;avatar&quot;]=&gt;
          string(116) &quot;https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/c9/c9442f1ea597a7685f8e50f2f7c922321beb4eba.jpg&quot;
          [&quot;avatarmedium&quot;]=&gt;
          string(123) &quot;https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/c9/c9442f1ea597a7685f8e50f2f7c922321beb4eba_medium.jpg&quot;
          [&quot;avatarfull&quot;]=&gt;
          string(121) &quot;https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/c9/c9442f1ea597a7685f8e50f2f7c922321beb4eba_full.jpg&quot;
          [&quot;avatarhash&quot;]=&gt;
          string(40) &quot;c9442f1ea597a7685f8e50f2f7c922321beb4eba&quot;
          [&quot;lastlogoff&quot;]=&gt;
          int(1593317334)
          [&quot;personastate&quot;]=&gt;
          int(0)
          [&quot;realname&quot;]=&gt;
          string(44) &quot;por erro em estudo sobre a hidroxicloroquina&quot;
          [&quot;primaryclanid&quot;]=&gt;
          string(18) &quot;103582791454640235&quot;
          [&quot;timecreated&quot;]=&gt;
          int(1328817888)
          [&quot;personastateflags&quot;]=&gt;
          int(0)
          [&quot;loccountrycode&quot;]=&gt;
          string(2) &quot;CN&quot;
          [&quot;locstatecode&quot;]=&gt;
          string(2) &quot;32&quot;
          [&quot;loccityid&quot;]=&gt;
          int(9982)
        }
      }
    }
  }
  </code></pre>
  <p>How can i extract steamid from $array?
  Already tryed this links
  <a href="https://www.codewall.co.uk/how-to-read-json-file-using-php-examples/" rel="nofollow noreferrer">https://www.codewall.co.uk/how-to-read-json-file-using-php-examples/</a>
  <a href="https://www.php.net/manual/pt_BR/function.json-decode.php" rel="nofollow noreferrer">https://www.php.net/manual/pt_BR/function.json-decode.php</a></p>