check http://www.php.net/manual/en/function.nl2br.php
you could also do a regex, searching for \n, and adding a <P> to it...adding
the </P> would make it a little more difficult...
-jack
-----Original Message-----
From: Romulo Roberto Pereira [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 1:09 PM
To: Php-General
Subject: [PHP] Wrapping text to store in the database
Hello!
If a user drop a text like this in a textarea:
---
the U.S. Army's 3rd Infantry Division, 15th Regiment, A Company, seized a
44-car train in a tunnel 60 miles south of Salzburg, Austria. It contained
an incalculable fortune in fine art, bullion, jewelry, furs, coins, stamp
collections, cameras, china, linens, silver, Oriental rugs, furniture, and
anything else of value that a pro-Nazi Hungarian government looted from
Jewish households during World War II.
The Nazis, who surrendered on May 8, 1945, had been hoping to send the goods
westward toward Germany ahead of the Russian advance.
It never made it.
But neither did its contents revert to those who lost them, nor were they
compensated, despite U.S. policy dictating that anything identifiable be
returned to its nation of origin.
U.S. officials decided that the train's booty couldn't be traced to
Hungary's Jews, and over the Hungarian Jewish community's fierce protests,
sold it at auction, at military exchanges, used it in government offices and
officials' homes, and in some cases, simply stole it.
---
As you can see the text is simple and there are not any html tags. How do I
do to add this elements so the text become something like this below, I mean
how to wrap it up in html tags?
---
<p>the U.S. Army's 3rd Infantry Division, 15th Regiment, A Company, seized a
44-car train in a tunnel 60 miles south of Salzburg, Austria. It contained
an incalculable fortune in fine art, bullion, jewelry, furs, coins, stamp
collections, cameras, china, linens, silver, Oriental rugs, furniture, and
anything else of value that a pro-Nazi Hungarian government looted from
Jewish households during World War II.</p>
<p>The Nazis, who surrendered on May 8, 1945, had been hoping to send the
goods westward toward Germany ahead of the Russian advance.</p>
<p>It never made it.</p>
<p>But neither did its contents revert to those who lost them, nor were they
compensated, despite U.S. policy dictating that anything identifiable be
returned to its nation of origin.</p>
<p>U.S. officials decided that the train's booty couldn't be traced to
Hungary's Jews, and over the Hungarian Jewish community's fierce protests,
sold it at auction, at military exchanges, used it in government offices and
officials' homes, and in some cases, simply stole it.</p>
---
Ideas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]