Re: Pulling out string from a string

From: Date: Tue, 04 May 2004 21:43:16 +0000
Subject: Re: Pulling out string from a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185358@lists.php.net to get a copy of this message
Ryan Schefke wrote:
Can anyone help me with the code to pull out "clientxxx" from the below string: /tgwedding/users/client1/sites/testgrabid.php I use $PHP_SELF to get the directory structure of the page and store that string as a variable. Then, I want to pull out the string "clientxx", where "xx" can be any given number. Thanks, Ryan
preg_match('!/([^/]+\d+)/!', $_SERVER['PHP_SELF'], $matches); $clientxxx = $matches[1]; -- paperCrane <Justin Patrin>

« previous php.general (#185358) next »