I need valid numbers between 0.00000001 and 999. I used preg_match:
preg_match('/^[0-9]{1,3}(\.[0-9]{1,8})?$/',0.0000339);
But I don't understand why it doesn't work. If I write a number: 0.0001
it work but 0.00001
or 0.0000001
it doesn't work and 0.11111111
returns true. You can test http://writecodeonline.com/php/ Why?
It work:
$number = 0.0000001;
echo preg_match('/^[0-9]{1,3}(\.[0-9]{1,8})?$/',"$number");