Empty commit

This commit is contained in:
Git 2013-08-21 08:00:53 +00:00
parent 89e3637145
commit 814e3b91c4

View File

@ -5,11 +5,17 @@
/** /**
* Return true if the given string is numeric. * Return true if the given string is numeric.
* *
* @param string $Str * @param mixed $Str
* @return true if $Str numeric * @return bool
*/ */
if (PHP_INT_SIZE === 4) { if (PHP_INT_SIZE === 4) {
function is_number($Str) { function is_number($Str) {
if ($Str === null || $Str === '') {
return false;
}
if (is_int($Str)) {
return true;
}
if ($Str[0] == '-' || $Str[0] == '+') { // Leading plus/minus signs are ok if ($Str[0] == '-' || $Str[0] == '+') { // Leading plus/minus signs are ok
$Str[0] = 0; $Str[0] = 0;
} }