title: How to get only a few indexes of the data array?
body: <p>I'm having trouble with the second iteration of this, take a look at the code below:</p>
  
  <pre><code>include ('rest.php');
  include ('header.php');
  include ('topo.php');
  include ('menu.php');
  
  $token = $_COOKIE['token'];
  
  $table1 = "&lt;div class='pai-forms'&gt;
             &lt;table id='calendarTable'&gt;
              &lt;tr&gt;
                &lt;th&gt;Posição Array&lt;/th&gt;
                &lt;th&gt;Nome&lt;/th&gt;
                &lt;th&gt;Email&lt;/th&gt;
                &lt;th&gt;CEP&lt;/th&gt;
                &lt;th&gt;Numero&lt;/th&gt;
                &lt;th&gt;Complemento&lt;/th&gt;
                &lt;th&gt;Rua&lt;/th&gt;
                &lt;th&gt;Logo&lt;/th&gt;
                &lt;th&gt;Latitude&lt;/th&gt;
                &lt;th&gt;Longitude&lt;/th&gt;
                &lt;th&gt;Ativo&lt;/th&gt;
                &lt;th&gt;Criado&lt;/th&gt;
                &lt;th&gt;Atualizado&lt;/th&gt;
              &lt;/tr&gt;";
  
  $table2 = " &lt;/table&gt;
           &lt;/div&gt;";
  
  $dataSalons = wsListSalons($token);
  
  echo $table1;
  foreach ($dataSalons['data'] as $key =&gt; $value) {
    echo "&lt;tr&gt;";
    for ($i = 1; $i &lt; 6; $i++) { // HERE IS THE PROBLEM
      echo "&lt;td&gt;".$value[$key]."&lt;/td&gt;";
    }
    echo "&lt;/tr&gt;";
  }
  echo $table2;
  
  include ('footer.php');
  </code></pre>
  
  <p>I just wanna get the data of indexes 1 through 6 of the array, but when this line <code>for ($i = 1; $i &lt; 6; $i++)</code> executes, it throws many of these errors: </p>
  
  <blockquote>
    <p>Notice: Undefined offset: 0 in C:\xampp\htdocs\mcisalaositeadmin\list_salons.php on line 39<br>
    Notice: Undefined offset: 0 in C:\xampp\htdocs\mcisalaositeadmin\list_salons.php on line 39<br>
    Notice: Undefined offset: 1 in C:\xampp\htdocs\mcisalaositeadmin\list_salons.php on line 39<br>
    Notice: Undefined offset: 1 in C:\xampp\htdocs\mcisalaositeadmin\list_salons.php on line 39<br></p>
  </blockquote>
  
  <p>What am I missing?</p>
  
  <p>PS: I just tried it with a foreach loop, and it works, but it returns to me all of the indexes data. I just wanna get the indexes data 1 though 6.</p>