Use filter_var()
with FILTER_VALIDATE_FLOAT
if (filter_var($amount, FILTER_VALIDATE_FLOAT))
{
// good
}
More Related Contents:
- Regex For a Simple Validation [closed]
- PHP validation/regex for URL
- PHP – Floating Number Precision [duplicate]
- How to validate an Email in PHP?
- Checking if form has been submitted – PHP
- php date validation
- Easiest Form validation library for PHP? [closed]
- What is the best way to validate a credit card in PHP?
- Checking if all the array items are empty PHP
- Display float value w/o scientific notation
- PHP unexpected result of float to int type cast
- How to “Validate” Human Names in CakePHP?
- PHP regular expression for strong password validation [duplicate]
- PHP: Best way to check if input is a valid number?
- Selecting a float in MySQL
- Laravel password validation rule
- Validating US phone number with php/regex
- get_headers Inconsistency [closed]
- Comparing floats – same number, but does not equal? [duplicate]
- How validate unique email out of the user that is updating it in Laravel?
- How to Validate on Max File Size in Laravel?
- Regex for password PHP [duplicate]
- Custom validator in Laravel 5
- Extract floating point numbers from a delimited string in PHP
- Best way to check for positive integer (PHP)?
- How to return custom error message from controller method validation
- Which function in php validate if the string is valid html?
- Number in the top-level domain?
- Laravel: Validate maximum File size?
- Check if laravel model got saved or query got executed