View Full Version : Newline and Tab in PHP
Is there a way to sent a new line (i.e. \n) and tab (i.e. \t) in php???
i am trying to format some output that i get and i need to be able to place returns and tabs into it
thanks
http://www.wellho.net/regex/php.html
I just use html codes such as <br>
IE:
echo "<br>";
There's a function to convert newlines to <br />'s in php already.
nl2br($string);
http://uk.php.net/manual/en/function.nl2br.php
See also :
htmlspecialchars(); (http://uk.php.net/manual/en/function.htmlspecialchars.php)
htmlentities(); (http://uk.php.net/manual/en/function.htmlentities.php)
wordwrap(); (http://uk.php.net/manual/en/function.wordwrap.php)
As for usage, I'd put these on the output (i.e. input from the DB, output to the page) rather than cluttering the DB up with hundreds of <br />'s and &'s
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.