str_starts_with
str_starts_with ( $haystack, $needle )
Parameters:- (string) haystack The string to search in.
- (string) needle The substring to search for in the `$haystack`.
Returns:- (bool) True if `$haystack` starts with `$needle`, otherwise false.
Defined at: - Introduced in WordPress: 5.9.0
- Deprecated in WordPress: —
Description
Polyfill for `str_starts_with()` function added in PHP 8.0.Performs a case-sensitive check indicating if
the haystack begins with needle.