Home > PHP > Function > Strings > stristr()

stristr()

stristr - Case-insensitive

strstr()

Syntax

string stristr (string $haystack, mixed $needle, bool $before_needle)

Arguments

  • haystack - The string to search in
  • needle - If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
  • before_needle - If TRUE, stristr() returns the part of the haystack before the first occurrence of the needle.

Description

Returns all of haystack from the first occurrence of needle to the end.

Version

PHP 4, 5

Return value

Returns the matched substring. If needle is not found, returns FALSE.