← All built-ins / strstr()
strstr()
strstr(string $haystack, string $needle): string
Parameters
| Name | Type | Description |
|---|---|---|
| $haystack | string | string to search in |
| $needle | string | string to search for |
Return value
The part of $haystack starting at the first $needle, or false when not found.
Example
echo strstr("user@mail.com", "@"), "
";
var_dump(strstr("user@mail.com", "!") === false);@mail.com bool(true)