You have probably defined $name, $date, $text or $date2 to be a string, like:
1 2 3 |
$name = 'String'; |
Then if you treat it like an array it will give that fatal error:
1 2 3 |
$name[] = 'new value'; // fatal error |
To solve your problem just add the following code at the beginning of the loop:
1 2 3 4 5 6 |
$name = array(); $date = array(); $text = array(); $date2 = array(); |
This will reset their value to array and then you’ll able to use them as arrays.
By ‘shoe’