PHP function strstr()
Availability in PHP 4.0
Find first occurrence of a string
Parameters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$haystack |
string |
not | String being processed. |
$needle |
mixed |
not | If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. |
$before_needle |
bool |
null | If true, strstr returns the part of the haystack before the first occurrence of the needle. |
Return values
string
the portion of string, or false if needle is not found.