Home >> PHP >> strchr() function in PHP

strchr() function in PHP

The strchr() function used for find first occurrence of a string inside another string.

Alias of strstr()

Syntax

strchr(string,search,before_search);

Example

echo strchr("Hello Dear","Dear",true);

Output

Hello

Post Your Comment

Next Questions
strcmp() function
strcspn() function
strip_tags() function
stripslashes() function
stripos() function
stristr() function
strlen() function
strnatcasecmp() function
strnatcmp() function
strncasecmp() function
strncmp() function
strpbrk() function
strpos() function
strrchr() function
strrev() function
strripos() function
strrpos() function
strspn() function
strstr() function
strtok() function
strtolower() function
strtoupper() function
strtr() function
substr() function
substr_compare() function

Copyright ©2022 coderraj.com. All Rights Reserved.