i want to extract a match from a string. I have these working:
/myid=[0-9][0-9][0-9]/
on "index.php?foo=Y&myid=123456&bar=2"
with the result
Array
(
[0] => Array
(
[0] => myid=123
)
)
or
/myid=[0-9]{7}|[0-9]{6}|[0-9]{5}|[0-9]{4}/
Array
(
[0] => Array
(
[0] => 123456
)
)
"myid" is between 4 and seven digits and i need to get the full number hence
why i check for 7 first.
/myid=[0-9]{7}|myid=[0-9]{6}|myid=[0-9]{5}|myid=[0-9]{4}/
Array
(
[0] => Array
(
[0] => myid=123456
)
)
Just tried this... it works, it is what i want, but it just seems way OTT. Is
there a simpler way?
Much cleaner would be a way of extracting just the digits after ensuring it
followed "myid=" but i can do that on a second call if needed.
TIA
--
Michael
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]