Re: Re: Find match of string if only at end of string
| From: | tamouse mailing lists | Date: | Wed, 11 Jul 2012 17:13:49 +0000 |
| Subject: | Re: Re: Find match of string if only at end of string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318426@lists.php.net to get a copy of this message | ||
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/:$'