RE: [PHP] Re: preg_replace("/^\//".. doesnt work?
| From: | scott | Date: | Wed, 20 Feb 2002 20:13:06 +0000 |
| Subject: | RE: [PHP] Re: preg_replace("/^\//".. doesnt work? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85579@lists.php.net to get a copy of this message | ||
Also note:
"^" matches the beginning of the string, so "^\/"
will only match a "/" at the beginning of the
string (not the first occurence of "/")
> -----Original Message-----
> From: Philip Hallstrom [mailto:philip@adhesivemedia.com]
> Subject: [PHP] Re: preg_replace("/^\//".. doesnt work?
>
> $a = "/test/";
> $a = preg_replace("/^\//", "", $a);
> echo $a;
>
> On Wed, 20 Feb 2002, John Ericson wrote:
> >
> > I want preg_replace to replace the first '/' in $a with '' so that the
> > echo function echoes "test/", but instead it echoes "/test/" as if
> > preg_replace didnt worked? What am I doing wrong?
> >