STRPBRK(3) 1 STRPBRK(3)
strpbrk - Search a string for any of a set of characters
SYNOPSIS
string strpbrk (string $haystack, string $char_list)
DESCRIPTION
strpbrk(3) searches the $haystack string for a $char_list.
PARAMETERS
o $haystack
- The string where $char_list is looked for.
o $char_list
- This parameter is case sensitive.
RETURN VALUES
Returns a string starting from the character found, or FALSE if it is not found.
EXAMPLES
Example #1
strpbrk(3) example
<?php
$text = 'This is a Simple text.';
// this echoes "is is a Simple text." because 'i' is matched first
echo strpbrk($text, 'mi');
// this echoes "Simple text." because chars are case sensitive
echo strpbrk($text, 'S');
?>
SEE ALSO
strpos(3), strstr(3), preg_match(3).
PHP Documentation Group STRPBRK(3)