Forum Moderators: coopster
$string = 'mystring/PD-12345';
preg_match("/PD-(\d+)/", $string, $matches);
print $matches[1];
My string value is something like this one.
[mydomain.com...]
I would like to retreive the value '21277586'
Your script works if it's "/PD-". Now that the string is "&PD=" When I replace it with...
preg_match("&PD=(\d+)/", $string, $matches);
I got this error.
Warning: Delimiter must not be alphanumeric or backslash
[edited by: irock at 9:46 pm (utc) on Oct. 20, 2003]