Php strpbrk
From w3cyberlearnings
Contents |
PHP function strpbrk
This function finds a string for any of a set of characters. It is case-sensitive.
Syntax strpbrk
- string: string input.
- chartlist: list of characters parameter
strpbrk(string, charlist);
Return
Return a string start from where it is found on the charlist.
Example 1
<?php echo strpbrk("She loves to tell a story!","yrs"); ?>
Output: Found 's' in the word 'loves'
s to tell a story!
Example 2
<?php echo strpbrk('Great Lady is also a great mother.','mai'); ?>
Output: It found 'a' at the word 'Great'
at Lady is also a great mother.