Re: ereg questions
| From: | Ker Ruben Ramos | Date: | Wed, 23 May 2001 17:49:19 +0000 |
| Subject: | Re: ereg questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54102@lists.php.net to get a copy of this message | ||
hmm, got a little question.
1. what's that \\1 and \\2? got any info on where u got that from?
2. what if it's just href="anything.html" ? i mean.. something like it got
lots of subdirectories or not.
Thanks
----- Original Message -----
From: "Mark Maggelet" <maggelet@mminternet.com>
To: <kramz@iligan.mine.nu>
Sent: Thursday, May 24, 2001 1:19 AM
Subject: Re: [PHP] ereg questions
> On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos
> (kramz@iligan.mine.nu) wrote:
> >How do i change all '<a href="anything/here.html">' to
> >'<a
> >href="file.php?file=anythinghere.php">'
> >any help out there?
>
> I would go:
>
> $string = ereg_replace(
> "<a href=\"([^/]+)/(.*)\\.html\">",
> "<a href=\"file.php?file=\\1\\2.php\">",
> $string);
>
> - Mark
>
>
>