开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜