The piece of code is quite simple. I'm trying to insert in a table every sentence contained in the variable $str separated by a '@'. The problem is that it doesn't stop to the end of the array in the for loop and keeps creating new blank rows.

```
    <?php
    require_once("database/functions.php");

    $str = "text@text@text...";

    $arr = explode('@', $str);
    var_dump($arr);

    global $ConnectionClass;
    $ConnectionClass->Connect();

    for($i = 0; i < count($arr); $i++){
        $check = $ConnectionClass->mysqli->query("INSERT INTO flow VALUES('', '$arr[$i]', '', '', '', '')");
        if(!$check) die("Impossibile dialogare con il Database.");
    }

    $ConnectionClass->Close();

    ?>

```