NYCPHP Meetup

[nycphp-talk] Rewrite rule functionality

Dan Cech dcech at phpwerx.net
Tue Mar 4 07:18:38 EST 2008


Urb LeJeune wrote:
> An Apache a rewrite rule in the form of:
> 
> /country/(..)\.html
> 
> returns the two characters enclosed between the parenthesis as $1.
> If there a PHP function with the same functionality?
> 
> I want to use PHP to return the digits in a string like:
> 
> stuff [mailid=1234] more stuff.

Urb,

The function you are looking for is preg_match

http://php.net/preg_match

Also, don't start a new thread by responding to an existing thread and 
deleting the text, create a new email.

Dan



More information about the talk mailing list