X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP strpbrk() Function

PHP String Reference PHP String Reference

Example

Search a string for the characters "oe", and return the rest of the string from where it found the first occurrence of the specified characters:

<?php
echo strpbrk("Hello world!","oe");
?>

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 from where it found the first occurrence of a specified character, otherwise it returns FALSE.


Syntax

strpbrk(string,charlist)

Parameter Description
string Required. Specifies the string to search
charlist Required. Specifies the characters to find

Technical Details

Return Value: Returns the string starting from the character found, otherwise it returns FALSE
PHP Version: 5+


More Examples

Example 1

This function is case-sensitive ("W" and "w" will not output the same):

<?php
echo strpbrk("Hello world!","W");
echo "<br>";
echo strpbrk("Hello world!","w");
?>

Run example »


PHP String Reference PHP String Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook