Reputation: 1829
I have a string
Hobbies#14285723739878005#reading#Reading
I need the count of number of occurrence of '#' in the string. How to get that?
Upvotes: 0
Views: 84
Reputation: 362
substr_count() should do what you need:
http://www.w3schools.com/php/func_string_substr_count.asp
Upvotes: 0
Reputation: 3424
try this code:
<?php
echo substr_count("Hobbies#14285723739878005#reading#Reading","#");
?>
Output:-
3
For your reference Click Here
Upvotes: 4