The whole purpose of this is to break at every 75th character in string $texttest
Please give constructive criticism, I know very little of arrays...
Code: Select all
$texttest = "blabla -> and 300 more bla:s";
$stringlenght = strlen($texttest);
$maxstringlenght = 75;
$rowbreakresult = array();
$amount = $stringlenght/$maxstringlenght;
$rows = round($amount);
$firstline = 0;
if( $stringlenght > $maxstringlenght ) {
for( $firstline; $firstline <= $rows; $firstline++) {
$fm = $firstline*$maxstringlenght;
$tempstr = substr($texttest, $fm, $maxstringlenght);
$tempstr = $tempstr + "<br>";
$rowbreakresult["$firstline"] = $tempstr;
}
}
$int = 0
while( $rowbreakresult[$int] == true ) {
echo $rowbreakresult[$int];
$int = $int+1;
}