Created
July 13, 2015 18:29
-
-
Save webkader/eb7d1c0e22b6c950bf5b to your computer and use it in GitHub Desktop.
Check if a string is a valid float
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidFloat($float) | |
{ | |
if (filter_var($float, FILTER_VALIDATE_FLOAT)) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment