strpbrk() function will searches a string for any of the specified characters.
Note : case-sensitive function.
[table caption=”” width=”100%” colwidth=”15%|15%|15%|55%” colalign=”left|left|left|left”]
Name, Required /Optional, Value Type, Description
string, Required, String, It is the string in which search will take place.
char_list, Required, String, It species the characters list that is to be search in the string.
[/table]
It returns the remaining string from where the first occurrence of the char_list is found in the string and Otherwise it returns FALSE.
This will start outputting from “m tutorialmines.” because it will find “m” character first occurrence and return the string from their only.
<?php // case-sensitive echo strpbrk("Hi from tutorialmines.","tm"); ?>
Output of above code in the browser is as below:
It returns FALSE if char_list is not found in string. See in example for letter “T”. But for letter “f” it returned the string from the point where it is found.
<?php var_dump(strpbrk("Hi from tutorialmines.","T")); // return FALSE if char_list is not found in string echo "<br/>"; echo strpbrk("Hi from tutorialmines.","f"); ?>
Output of above code in the browser is as below:
When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…
In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…
In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…
In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…
When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…
In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…