I'm having a really bad issue here and I can't find anything about it online... this is my website:
<http://top6.com>

when you try to go to a page from FireFox, it shows you the page then redirects you back to the previous one... this only happens with FireFox and only happens if I'm not in a Private window. I tried to disable all plugins I have installed, didn't work. Checked htaccess, seems fine... Checkev for malware - none. Don't know what else to do... any help is highly appreciated...
['https://Stackoverflow.com/questions/35089135', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5261700/']
Use `array_chunk()` to split your array into arrays of size 4, then iterate row wise over data using `foreach`.

```
$links = array(
  array("Link 1", "link_href1"),
  array("Link 2", "link_href2"),
  array("Link 3", "link_href3"),
  array("Link 4", "link_href4"),
  array("Link 5", "link_href5"),
  array("Link 6", "link_href6"),
  array("Link 7", "link_href7"),
  array("Link 8", "link_href8"),
  array("Link 9", "link_href9"),
);

$divsPerRow = 4;
foreach(array_chunk($links,$divsPerRow) as $row) {
  echo "<div class=\"row\">\n";
  foreach($row as $col) {
    list($label,$link) = $col;
    echo "\t<div class=\"col-xs-3 col-sm-6\">\n\t\t<a href=\"$link\">$label</a>\n\t</div>\n";
  }
  echo "</div>\n";
}

```

Can even handle scenarios where `count($links)` is not a multipe of 4. Just set `$divsPerRow` to the desired value.

Output:

```
<div class="row">
    <div class="col-xs-3 col-sm-6">
        <a href="link_href1">Link 1</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href2">Link 2</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href3">Link 3</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href4">Link 4</a>
    </div>
</div>
<div class="row">
    <div class="col-xs-3 col-sm-6">
        <a href="link_href5">Link 5</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href6">Link 6</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href7">Link 7</a>
    </div>
    <div class="col-xs-3 col-sm-6">
        <a href="link_href8">Link 8</a>
    </div>
</div>
<div class="row">
    <div class="col-xs-3 col-sm-6">
        <a href="link_href9">Link 9</a>
    </div>
</div>

```

Live example can be found at: <http://sandbox.onlinephpfunctions.com/code/0075882e8abeda68ed1807b6d738714145b302e8>
you can also try a foreach loop: 

```
$i = 0;  
foreach ($links as $link) {  
    if ($i == 0) {  
        echo '<div class="row">';  
    }  
    #...  
    echo '<a href="' . $link[1] . '">' . $link[0] . '</a>';  
    #...  
    ++$i;  
    if ($i == 4) {  
        echo '</div>';  
        $i = 0;  
    }  
}  
if ($i != 0) {  
    echo '</div>';  
}  

```