Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 7, 2019 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/e71cebbaa6e501bcfeef8bfa8dc98c47 to your computer and use it in GitHub Desktop.
Save parzibyte/e71cebbaa6e501bcfeef8bfa8dc98c47 to your computer and use it in GitHub Desktop.
<?php
function endsWith($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment