Re: Re: Find match of string if only at end of string
| From: | marco@behnke.biz | Date: | Thu, 12 Jul 2012 06:37:07 +0000 |
| Subject: | Re: Re: Find match of string if only at end of string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318428@lists.php.net to get a copy of this message | ||
tamouse mailing lists <tamouse.lists@gmail.com> hat am 11. Juli 2012 um 19:13
geschrieben:
> On Wed, Jul 11, 2012 at 11:45 AM, Marc Guay <marc.guay@gmail.com> wrote:
> > Answered it myself (funny how writing out a problem as descriptively
> > as possible makes the brain work better).
> >
> > $end_of_url =
> > substr("http://domain.com/about/page/subpage/",
> > strlen("/about/page/") * -1);
> > $same_post = ($end_of_url == "/about/page/");
>
> or regex: ':/about/page/:$'
':/about/page/$:'
^^
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3
Tel.: 0174 / 9722336
e-Mail: marco@behnke.biz
Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal
http://www.behnke.biz