Wrapping Text : wordwrap « String « PHP
- PHP
- String
- wordwrap
Wrapping Text
<?php
$astring = "Hello\nWorld\n\nHow are you?";
echo nl2br ($astring) . "<br />";
$textblock = "this is a test. this is a test. this is a test. this is a test. this is a test. !";
echo wordwrap ($textblock, 20, "<br />");
?>
Related examples in the same category