Created
May 27, 2016 20:21
-
-
Save jserle/a03d1ad242ce8db45bf9b248ae5a3220 to your computer and use it in GitHub Desktop.
PetCheck
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
<?php | |
if (empty($argv[1])) { | |
die("\nPetCheck Test App\n----------------------\nType an argument after the script name" | |
. " to determine if it's an int or double.\n\n"); | |
} | |
$in = $argv[1]; | |
if ($in === strval(intval($in))) { | |
die("$in is an INT\n"); | |
} elseif ($in === strval(floatval($in))) { | |
die("$in is a DOUBLE\n"); | |
} else { | |
die("$in is not an INT or a DOUBLE\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment