Monday, 29 September 2014

strpbrk in PHP

PHP strpbrk() function is utilized to search a string for any set of characters.

PHP strpbrk() function returns the rest of the string from where it discovered the first event of a specified character, otherwise it returns FALSE.

Syntax:

strpbrk(string,charlist)
string : Required. Specifies the string to search

charlist : Required. Specifies the string being searched for.

Tip: This function is case-sensitive.

Example:

<?php
echo strpbrk("Good Morning","dr");
?>
Output will be:
d Morning

0 comments:

Post a Comment