Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php check if string ends with

function endsWith( $haystack, $needle ) {
    $length = strlen( $needle );
    if( !$length ) {
        return true;
    }
    return substr( $haystack, -$length ) === $needle;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #check #string #ends
ADD COMMENT
Topic
Name
3+4 =