Javatpoint Logo
Javatpoint Logo

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:

Parameter Description Required/Optional
string Specify the string to search Required
charlist Specify the character to find Required

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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA