WPDev.one
Core Function
View Source on Trac ↗

str_ends_with()

str_ends_with( mixed $haystack, mixed $needle )

Polyfill for `str_ends_with()` function added in PHP 8.0.

Parameters 2 required

Name / Type Description
$haystack
string

The string to search in.

Required
$needle
string

The substring to search for in the `$haystack`.

Required

Return Value

(bool)
True if `$haystack` ends with `$needle`, otherwise false.

Function Information

Since Version
5.9.0
Source File
wp-includes/compat.php
Advertisement