toledorobia
1/5/2018 - 3:24 PM

PHP - Ends with

PHP - Ends with

<?php
function ends_with($haystack, $needle) {
    return $needle === "" || substr($haystack, -strlen($needle)) === $needle;
}
?>