Uncannytable Posted July 8, 2006 Share Posted July 8, 2006 What is the command for counting the number of times a letter appears on a string? Link to comment https://forums.phpfreaks.com/topic/14030-i-need-help/ Share on other sites More sharing options...
Kurt Posted July 8, 2006 Share Posted July 8, 2006 Use substr_count($string,"Text to search for"). Example:[code]$count=substr_count('Phpfreaks rocks!','p');echo $count;//outputs 2[/code] Link to comment https://forums.phpfreaks.com/topic/14030-i-need-help/#findComment-54813 Share on other sites More sharing options...
Uncannytable Posted July 9, 2006 Author Share Posted July 9, 2006 Thanks.it helped a lot. Link to comment https://forums.phpfreaks.com/topic/14030-i-need-help/#findComment-55102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.