Re: preserving tabs

From: Date: Wed, 05 Jul 2000 00:10:35 +0000
Subject: Re: preserving tabs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4833@lists.php.net to get a copy of this message
> when i insert a text field into mysql, it sometimes contains tabs, > but when i view the record on a html page the tabs have gone. > doing a select on the table from the mysql command line, show the tabs > present. > Using \" $mytext\" when displaying the txt field does not fix it Tabs don't have any special meaning in HTML and will be treated like a space. If you want to keep them equivalent to a few spaces, try something like str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $text) or wrap the entire output block in <PRE></PRE>.

« previous php.general (#4833) next »