PHP strpbrk() Function

The strpbrk() function is predefine string function of PHP. It is used to search a string for any of the specified characters or search a string for any of a set of character.

Note: This function strpbrk() is case-sensitive.

Syntax:

ParameterDescriptionRequired/Optional
stringSpecify the string to searchRequired
charlistSpecify the character to findRequired

It returns the rest of the string from where it found the first occurrence of any of the specified character.

Example 1

Output:

Your string:Hello javatpoint
	By using 'strpbrk()' function:ello javatpoint

Example 2

Output:

Your string:This is a Simple text.
	By using 'strpbrk()' function:Simple text.

Example 3

Output:

Your string:This is a Simple text.
	By using 'strpbrk()' function: is is a Simple text.

See Also :

  • strcasecmp() : It is used to compare two strings.
  • strchr() : It is used to find the first occurrence of a string inside another string.
  • stscroll() : It is locale based string comparison.
  • strcmp() : It is binary safe string comparison.

Reference:

http://php.net/manual/en/function.strpbrk.php


Next TopicPHP String




Latest Courses