Use Loop inside loop for for/while condion to fill table row by row

I have oracle function which return for me 1 long string. I used preg_split to convert string to array(string devided by comma).

$keywords = preg_split("/[/s,]+/", $oracle_return);

Now I can get data as array $keywords[1], $keywords[2] and etc. I have 73 parts of array. I need to fill these values to table which consist of 7 columns and 12 rows. So here is my code. I want to use loop which will do same as this example bellow(It will bring me all values from my query row by row):

while($row = sqlsrv_fectch_array($connection,$query))
{
$fist_column=$row['first_column'];

echo "<td>".$fist_column."</td>";
}

Here is my loop which I want to fill table with data row by row 7X12.
Question: How can I add +1 to $x for each step?

while($i<=12)     //Or i can use for($i=0;$i<=12;$i++)
{ 
  $i++; 
  echo "
  <tr>
    <td>".$year. "</td>
    <td>".$month. "</td>
    <td>".$keywords[$x]. "</td>     //if $x=1 so, equal to $keywords[1]
    <td>".$keywords[$x+1]. "</td>   //$keywords[2]
    <td>".$keywords[$x+2]. "</td>   //$keywords[3]
    <td>".$keywords[$x+3]. "</td>   //$keywords[4]
    <td>".$keywords[$x+4]. "</td>   //$keywords[5]
  </tr>";
  }

Is this what you are looking for?
It will output the 72 items, 6on each line.

$keywords = range(1,73);
$year ="year";
$month ="month";
//For loop to 72
for($i=0;$i<72;)
{  
  echo "
  <tr>
    <td>".$year. "</td>
    <td>".$month. "</td>
    // Output the keywords
    <td>".$keywords[$i]. "</td>
    <td>".$keywords[$i+1]. "</td>
    <td>".$keywords[$i+2]. "</td>
    <td>".$keywords[$i+3]. "</td>
    <td>".$keywords[$i+4]. "</td>
    <td>".$keywords[$i+5]. "</td>
  </tr>/n";
    $i =$i +6; // add six to i to make sure it does not repeat itself.
}

I used a range just to make an example that works when you run it but you have to change that to your code.
https://3v4l.org/t4WUn

This will not output the last item but since you know it’s item 73 you can easily output it with echo $keywords[73]

I’ve just assumed that you want 6 items on each row (as in your last code example). The data I’ve populated is purely to show the results…

<?php
error_reporting ( E_ALL );
ini_set ( 'display_errors', 1 );

$arraySize = 73;
$keywords = [];
for ( $i = 0; $i < $arraySize; $i++ )   {
    $keywords[] = $i+1;
}

for ( $i = 0; $i < $arraySize; $i++ )   {
    if ( $i % 6 == 0 )  {
        if ( $i > 0 )   {
            echo "</tr>".PHP_EOL;
        }
        echo "<tr>";
    }
    echo "<td>".$keywords[$i]."</td>";
}
echo "</tr>".PHP_EOL;

Which outputs…

<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr>
<tr><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td></tr>
<tr><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td></tr>
<tr><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td></tr>
<tr><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td></tr>
<tr><td>31</td><td>32</td><td>33</td><td>34</td><td>35</td><td>36</td></tr>
<tr><td>37</td><td>38</td><td>39</td><td>40</td><td>41</td><td>42</td></tr>
<tr><td>43</td><td>44</td><td>45</td><td>46</td><td>47</td><td>48</td></tr>
<tr><td>49</td><td>50</td><td>51</td><td>52</td><td>53</td><td>54</td></tr>
<tr><td>55</td><td>56</td><td>57</td><td>58</td><td>59</td><td>60</td></tr>
<tr><td>61</td><td>62</td><td>63</td><td>64</td><td>65</td><td>66</td></tr>
<tr><td>67</td><td>68</td><td>69</td><td>70</td><td>71</td><td>72</td></tr>
<tr><td>73</td></tr>