Re: ereg_replace
| From: | Richard Davey | Date: | Tue, 10 Feb 2004 18:37:10 +0000 |
| Subject: | Re: ereg_replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177306@lists.php.net to get a copy of this message | ||
Hello Nicole,
Tuesday, February 10, 2004, 5:55:01 PM, you wrote:
NL> Can anyone tell me why this does not work:
NL> $str1=ereg_replace("index.php?src=","index/",$url);
Because it's an invalid regular expression.
NL> is there another way to do this?
Yes, str_replace() for something this simple:
$str1 = str_replace("index.php?src=", "index/", $url);
--
Best regards,
Richard mailto:rich@launchcode.co.uk