Quantcast
Channel: How to count string occurrence in string? - Stack Overflow
Viewing all articles
Browse latest Browse all 43

Answer by Meghendra S Yadav for How to count string occurrence in string?

$
0
0

Try it

<?php $str = "33,33,56,89,56,56";echo substr_count($str, '56');?><script type="text/javascript">var temp = "33,33,56,89,56,56";var count = temp.match(/56/g);  alert(count.length);</script>

Viewing all articles
Browse latest Browse all 43

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>