Created
November 30, 2015 14:48
-
-
Save matusmarcin/fc9dff0ed50b1344d0ee to your computer and use it in GitHub Desktop.
My PHP improvement functions - very useful!
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
// Proper is_integer() check for dynamically typed PHP | |
// Yes, partly a joke. | |
function is_or_can_be_integer($value) { | |
return is_integer($value) || strcmp((string)(int)$value, $value) === 0; | |
} | |
// TODO | |
// Fix or wrap strpos() to return boolean. | |
// Fix all functions that use haystack needle or needle haystack params always in a different order. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment