Searches for the character "oe" in a string and returns the remainder of the string starting with the first occurrence of the specified character:
<?phpecho strpbrk("Hello world!","oe");?>The strpbrk() function searches a string for any of the specified characters.
Note: This function is case-sensitive.
This function returns the remainder starting from the first occurrence of the specified character. If not found, returns FALSE.
strpbrk( string,charlist )
parameter | describe |
---|---|
string | Required. Specifies the string to be searched for. |
charlist | Required. Specifies the characters to search for. |
Return value: | Returns the string starting with the character found. If not found, returns FALSE. |
---|---|
PHP version: | 5+ |
The function is case-sensitive ("W" and "w" output the same):
<?phpecho strpbrk("Hello world!","W");echo "<br>";echo strpbrk("Hello world!","w");?>