Using eregi_replace()
| From: | Anthony Ritter | Date: | Fri, 01 Aug 2003 14:33:50 +0000 |
| Subject: | Using eregi_replace() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157947@lists.php.net to get a copy of this message | ||
Using eregi_replace(), is there a way to take out a piece of a sentence -
which has spaces - and then return the new sentence?
For example, to return the new sentence:
hello I must be going
from the original sentence:
blah blah blah hello I must be going blah blah.
I tried:
...................
<?
$text="blah blah blah hello I must be going blah blah";
$text= eregi_replace("(hello.)(.going)","$newtext",$text);
echo $newtext;
?>
...........
Thank you.
Tony Ritter