note 32482 deleted from function.substr by stone
| From: | stone@php.net | Date: | Wed, 28 May 2003 20:20:05 +0000 |
| Subject: | note 32482 deleted from function.substr by stone | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49209@lists.php.net to get a copy of this message | ||
Note Submitter: rhallado@zipmail.com.br
----
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; }
}
?>