what is the syntax of the STRPBRK() function in php?
strpbrk(string,charlist)
Parameter | Description |
---|---|
string | Required. Specifies the string to search |
charlist | Required. Specifies the characters to find |
examples of the STRPBRK() function
Example 1. In this example, we 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");
?>
Example 2. 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");
?>