Created
February 2, 2021 14:27
-
-
Save gharabaghi/9e4dee712f80464a84122c7f79df40f0 to your computer and use it in GitHub Desktop.
php- determin if a string is float or not.
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
public static function isFloat($numberString) | |
{ | |
$regString = '/(^\d+\.\d+$|^\d+$)/'; | |
return (bool)preg_match($regString, $numberString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment