Last active
April 28, 2018 08:58
-
-
Save fxm90/7c6a3e7977cffb04935745db14b866b8 to your computer and use it in GitHub Desktop.
Checks whether all given parameters are numeric (Same as php-vanilla "is_numeric" but as variadic function).
This file contains hidden or 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
// Checks whether all given parameters are numeric. | |
// Usage: $validCoordinates = isNumeric($_GET['p1Lat'], $_GET['p1Lon'])); | |
function isNumeric() { | |
$numberOfArguments = func_num_args(); | |
$arguments = func_get_args(); | |
return count(array_filter($arguments, 'is_numeric')) === $numberOfArguments; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment