Created
October 2, 2016 21:17
-
-
Save RandomArray/22cf409eee82de6d743f1db413cdc8ac to your computer and use it in GitHub Desktop.
Function returns true if string contains only zeros. Used to check for invalid serial numbers consisting of only zeros.
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
| <?php | |
| function stringContainsOnlyZeros($s){ | |
| return (is_numeric($s) && (int)$s===0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment