protected function fileEndsWith(string $haystack, string $needle): bool
    {
        $length = strlen($needle);
        if (strlen($haystack) < $length) {
            return $this->fileEndsWith($needle, $haystack);
        }

        $haystack = str_replace('\\', '/', $haystack);
        $needle = str_replace('\\', '/', $needle);
        
        return (substr($haystack, -$length) === $needle);
    }
protected function fileEndsWith(string $haystack, string $needle): bool
    {
        $length = strlen($needle);
        if (strlen($haystack) < $length) {
            return $this->fileEndsWith($needle, $haystack);
        }

        $haystack = str_replace('\\', '/', $haystack);
        $needle = str_replace('\\', '/', $needle);
        
        return (substr($haystack, -$length) === $needle);
    }
protected function fileEndsWith ( string $ haystack , string $ needle ) : bool { $ length = strlen ( $ needle ) ; if ( strlen ( $ haystack ) < $ length ) { return $ this -> fileEndsWith ( $ needle , $ haystack ) ; } $ haystack = str_replace ( '\\' , '/' , $ haystack ) ; $ needle = str_replace ( '\\' , '/' , $ needle ) ; return ( substr ( $ haystack , - $ length ) === $ needle ) ; }
Find if two strings end in the same way
Find if two strings end in the same way