note 11931 added to function.ereg-replace.php
| From: | php-general at lists dot php dot net | Date: | Tue, 13 Mar 2001 22:03:19 +0000 |
| Subject: | note 11931 added to function.ereg-replace.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12353@lists.php.net to get a copy of this message | ||
here is a way to make whatever is typed in a textfield come out exactly how you typed it on a page
(eg. dynamic page generation)<<stolen from submitions made earlier>>
<pre>
/* Change them if you know what into */
$br='< BR >'; $p='< P >'; //remove the spaces from those i had to
put them in there for it to submit right
/* add remove modify it into whatever you think NewLines also are */
$chr="\n";
$out =ereg_replace($br."[ \t\n$br]*".$br, "\n$p",
ereg_replace("[$chr]", "\n$br", $textfield2));
$out = eregi_replace("[[:space:]]", " ", $out);
</pre>
http://www.php.net/manual/en/function.ereg-replace.php