formatted text, php and mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, hopefully someone can help me out with this..

I need to be able to copy text from a document, keeping carriage returns and white space chars, into a database and output the same to a web page.
I have a field in a mysql table of type 'longtext' into which i can load text and keep the white space and carriage return characters intact. 
I can output this field to a page using php in a similarly formatted way by using the <pre> tag in an echo statemnet : - 

echo "<tr><pre>$content</pre></tr>";

however, by using the <pre> tag all individual lines of text are printed on a single line and the sizing of my table is ignored, i.e. the text won't wrap. <pre width=20> for example doesn't work.

Is there a 'proper' way of doing something like this with php without relying on printing out html tags with the string?

cheers

Dan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux