phpcodec Posted October 18, 2008 Share Posted October 18, 2008 I need help with a php function Their is a function that counts the amount of instances of a string that is in another string so here is a example $letter = 'a'; $line = 'my name is phpcodec and i like to code php and asp'; their are 4 instances of $letter in $line Link to comment https://forums.phpfreaks.com/topic/128970-what-function/ Share on other sites More sharing options...
ghostdog74 Posted October 18, 2008 Share Posted October 18, 2008 $line = 'my name is phpcodec and i like to code php and asp'; $letter="a"; echo substr_count($line,$letter); always check the PHP manual first for references on PHP functions. Link to comment https://forums.phpfreaks.com/topic/128970-what-function/#findComment-668638 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.