Created
January 5, 2018 15:24
-
-
Save toledorobia/a7658568574ab9f1be458afc2c090870 to your computer and use it in GitHub Desktop.
PHP - Ends with
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 ends_with($haystack, $needle) { | |
return $needle === "" || substr($haystack, -strlen($needle)) === $needle; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment