Re: Pattern Matching[Resolved]
am 15.07.2009 18:19:49 von VamVan--0016368e252b9cf9c6046ec0ec63
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
On Wed, Jul 15, 2009 at 4:21 AM, Lenin
> On Wed, Jul 15, 2009 at 3:24 AM, VamVan
>
> > contact/me - Contact US
> >
> > perfect match would be easy because I can exactly look for what I want.
> >
> > It becomes tricky when I introduce wild cards like contact/* for example.
> It
> > could also be contact/me/*
> >
> > How would I match patterns for this kind of relative matches.? Any ideas
> > anyone?
>
>
> Use preg_match function to do that.
Ok here is how I solved it. When I have a url like www.xx.ccom/a/b/c for
example, what I do is
get an array of abc, ab, a
Then I run a union query for all three combinations. So basically select *
from {lookup_table} WHERE path = 'abc' UNION select ........
Then I just retrieve the first row mysql_fetch_object. That is what I need.
Thanks Anyways
V
--0016368e252b9cf9c6046ec0ec63--