PHP strpbrk() Function
Example
Search a string for the character "oe" and return the rest of the string starting from the first occurrence of the specified character:
Run Example »
Definition and Usage
The strpbrk() function searches a string for any of the specified characters.
**Note:** This function is case-sensitive.
This function returns the rest of the string starting from the first occurrence of the specified character. If not found, FALSE is returned.
Syntax
strpbrk(
string,charlist
)
| Parameters | Description |
|---|---|
| string | Required. Specifies the string to be searched. |
| charlist | Required. Specifies the characters to find. |
Technical Details
| Return Value: | Returns the string starting from the found character. If not found, FALSE is returned. |
|---|---|
| PHP Version: | 5+ |
More examples
Example 1
This function is case-sensitive ("W" and "w" produce the same output):
"; echo strpbrk("Hello world!","w"); ?>Run Example »
PHP String Reference Manual