The strchr() function is used to find the first appearance of a string inside another string. It is the pseudonym of the strstr() function. This function was introduced in PHP3.
strchr(string $haystack, string $needle, bool $before_needle = false): string|false
$record = "Fred,Flintstone,35,Wilma"; $rest = strchr($record, ","); // $rest is ",Flintstone,35,Wilma"
The variations on strstr() are:
stristr(): Case-insensitive strstr().
strchr(): Alias for strstr().
strrchr(): Find last occurrence of a character in a string.