| | |
Formatting text area
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2007
Posts: 110
Reputation:
Solved Threads: 1
I've just been reading a solved thread with this same title. The solution was nl2br. I was unaware of this function and have been using str_replace instead.
A problem arises however, when converting preformatted text, specifically a table. Either solution leaves a mass of space between text and a table due to all the new lines generated.
Is there a solution to this.
A problem arises however, when converting preformatted text, specifically a table. Either solution leaves a mass of space between text and a table due to all the new lines generated.
Is there a solution to this.
•
•
Join Date: Jul 2007
Posts: 110
Reputation:
Solved Threads: 1
Thanks MitkOK, you've done it again.
My problem arose because I only have a text area for input. Consequently I formatted the output from my database with the str_replace equivalent of nl2br.
However, I already had a preformatted article in the database which contained a table. I got around the problem by updating the database, so that the table code was all on the same line.
I assume I'd have to use the trim function only on table code?
My problem arose because I only have a text area for input. Consequently I formatted the output from my database with the str_replace equivalent of nl2br.
However, I already had a preformatted article in the database which contained a table. I got around the problem by updating the database, so that the table code was all on the same line.
I assume I'd have to use the trim function only on table code?
![]() |
Similar Threads
- A multilingual coded Hello World! thread (Legacy and Other Languages)
- OK, so, where's the Daniweb support area? (DaniWeb Community Feedback)
- Help needed for newbie trying to set up subscription-based website (PHP)
- cannot get the sendmail to actualy send an email with the form selections (PHP)
- Outlook, problem?? (Windows Software)
- Scroll Bars for the [Code][/Code] Tagged Portion (DaniWeb Community Feedback)
- Need to implemnt the RTF print in application (VB.NET)
- Using a control to just call the subroutine (VB.NET)
- Tutorials for Linux (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: Is this Right!
- Next Thread: Maintaining SESSIONS
| Thread Tools | Search this Thread |
apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database dataentry date display duplicates dynamic ebooks echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google href htaccess html image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching mediawiki menu mlm multiple mysql number oop paypal pdf php phpincludeissue problem query radio random recursion recursive remote script search server sessions shot sms source sp space speed sql subdomain subscription syntax system table tag tutorial tutorials update upload url validator variable vbulletin video web white youtube





