Lets say I have a text file with 9 sentences (it could be more! this is just an example) , then i read that file in my php and split it every 3 sentence and store it in a variable so it result in this array:
$table = array(
array(
'text number 1',
'text number 2',
'text number 3'
),
array(
'text number 4',
'text number 5',
'text number 6'
),
array(
'text number 7',
'text number 8',
'text number 9'
),
);
and then I want to add this string ('[br/]'
) between every array inside so it looks :
$table = array(
array(
'text number 1',
'text number 2',
'text number 3'
),
'[br/]', // <<< ---- the string here
array(
'text number 4',
'text number 5',
'text number 6'
),
'[br/]', // <<< ---- the string here
array(
'text number 7',
'text number 8',
'text number 9'
),
);
I've already tried this:
foreach( $table as $key => $row )
$output[] = array_push($row, "[br /]");
Which logically should have worked, but it hasn't.
Any help would be appreciated.