PHPStringstr_contains
strpos

str_containsString

str_starts_with

Determine if a string contains a given substring. (PHP 8+)

Syntax

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

Example

Enter values below to update the example in real time.

if
str_contains
echo
if (str_contains("Hello World", "World")) {
    echo "포함됨";
}