note 32482 added to function.substr

From: Date: Wed, 28 May 2003 20:10:06 +0000
Subject: note 32482 added to function.substr
Groups: php.notes 
Request: Send a blank email to php-notes+get-49207@lists.php.net to get a copy of this message
Esse script coloca um <br> depois de um determinado numero de caracteres... <? $text = "AABBCCDDEEFFGGHHIIJJLLMMNNOOPPQQRRSSTTWWUUVVXXZZ"; $maxchar = 4; $total = strlen($text); $linhas = ceil($total / $maxchar); while ($i <= $linhas) { $i++; $init = $init+$maxchar; if ( $i == '1' ) { $init = 0; } $resultado = substr("$text", $init, $maxchar). '<br>'; if ( $resultado != '' ) { echo $resultado; } } ?> ---- Manual Page -- http://www.php.net/manual/en/function.substr.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32482 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32482&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32482&report=yes

« previous php.notes (#49207) next »