str_contains

PHP 8
str_contains - Determine if a string contains a given substring

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

Performs a case-sensitive check indicating if needle is contained in haystack.

Parameters

haystack

The string to search in.

needle

The substring to search for in the haystack.

Return Values

Returns true if needle is in haystack, false otherwise.

Notes

Note:

This function is binary-safe.

Related Functions

Example of str_contains

Show all examples for str_contains

PHP Version:


Function str_contains:

Strings Functions

Most used PHP functions