PHP strstr() Function

The strstr() function searches for the first occurrence of a string inside another string.

string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] )

Returns part of haystack string starting from and including the first occurrence of needle to the end of haystack.

Example -

ParameterDescription
haystackThe input string.
needleIf needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
before_needleIf TRUE, strstr() returns the part of the haystack before the first occurrence of the needle (excluding the needle).

Returns the portion of string, or FALSE if needle is not found.