str_ends_with

PHP 8
str_ends_with - Checks if a string ends with a given substring

str_ends_with( string$haystack, string$needle ): bool

Performs a case-sensitive check indicating if haystack ends with needle.

Parameters

haystack

The string to search in.

needle

The substring to search for in the haystack.

Return Values

Returns true if haystack ends with needle, false otherwise.

Notes

Note:

This function is binary-safe.

Related Functions

Example of str_ends_with

Show all examples for str_ends_with

PHP Version:


Function str_ends_with:

Strings Functions

Most used PHP functions