Preg_match with regular expressions?
Im trying to catch a posted variable with name that begins with 'price' and ends开发者_StackOverflow with a number 0-9 and save the number in a variable $matches
. For some reason, the code i have isnt catching it, so obviously my syntax is off. Heres my code..
elseif (preg_match('price/[1-9]/', $field_name, $matches)) {
preg_match('/^price([0-9])$/', $field_name, $matches)
The $matches[1]
will give you the number.
精彩评论