On Thu, 25 Jul 2002 15:05:36 +0200, you wrote:
> l> for example:
> l> $mem='this is a test';
> l> preg_match('/test/', ...) should return me somehow: 10
How about this:
$mem='this is a test';
if(preg_match("/(.*)test/",$mem,$matches)) {
echo strlen($matches[1]);
}
Of course, if "test" occurs more than once then the above won't work,
since regex's are "greedy"...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

