str_starts_with
PHP 8
str_starts_with - Checks if a string starts with a given substring
str_starts_with(
string$haystack,
string$needle ): bool
Performs a case-sensitive check indicating if haystack begins with needle.
Parameters
- haystack
-
The string to search in.
- needle
-
The substring to search for in the haystack.
Return Values
Returns true if haystack begins with needle, false otherwise.
Notes
Note:
This function is binary-safe.