PHP 8 · Strings and arrays
Search in strings
Check the start, end or contents of a string.
str_contains($text, 'error');
str_starts_with($url, 'https://');
str_ends_with($file, '.php');
PHP 8 · Strings and arrays
Check the start, end or contents of a string.
str_contains($text, 'error');
str_starts_with($url, 'https://');
str_ends_with($file, '.php');
Was this page helpful?