int endswith(string haystack, string needle)
Returns 1 if the string ends with the given string. 0 otherwise.