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>
It appears you are using a 12 column grid (probably bootstrap). If might be helpful to not only put things in the proper divs, but also have the ability to change the style using php variables. Here is a little code snip that might help you:

```
$colSize = 3;
$colPrefix = "col-xs";
$numPerRow = 12/$colSize;

for($ii = 0; $ii<count($links); $ii++) {
    if ($ii % $numPerRow == 0) {
        echo "<div class='row'>\n";
    }
        echo "\t<div class='$colPrefix-$colSize'>\n";
        echo "\t\t<a href='{$links[$ii][1]}'>{$links[$ii][0]}</a>\n";
        echo "\t</div>\n";

    if ($ii % $numPerRow == $numPerRow-1 || $ii == count($links)-1) {
        echo "</div>\n";
    }
}

```

Naturally, this would just be a starting point. If you wanted to hard-code some of the html classes instead of using PHP variables, it should be easy enough to change. The important part is that you can set `$numPerRow` to whatever you need and the code will work from there.