php - preg_match problem -


i have written function:

public static function isdecimal($value, $places = 2)     {         if(preg_match("/^[0-9]+(\.[0-9]{".$places."})?$/", $value)) {             return true;         } else {             return false;         }     } 

which designed test whether value being entered number/decimal number. however, if enter number "23c.32" or "2b3.23" returns true. can point out fault lies in regex?

it works fine here. problem must somewhere near function call.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -