d.shankar Posted August 14, 2007 Share Posted August 14, 2007 I have a simple query for you. I have this string $str="this is monday and tommoro is tuesday this is"; in this i have to find the occurence of certain word , if i choose "is" then result is 3 , if i choose "this" the result is 2. please note that the string may be dynamic !! I have tried str_word_count and others but still ... :'( Link to comment https://forums.phpfreaks.com/topic/64830-word-count-occurence/ Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 then place a variable in the place where you are putting 'this' or 'is' and set it using your flow logic before calling the function. Link to comment https://forums.phpfreaks.com/topic/64830-word-count-occurence/#findComment-323469 Share on other sites More sharing options...
d.shankar Posted August 14, 2007 Author Share Posted August 14, 2007 Dont we have any functuion to achieve that ? Link to comment https://forums.phpfreaks.com/topic/64830-word-count-occurence/#findComment-323475 Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 preg_match Link to comment https://forums.phpfreaks.com/topic/64830-word-count-occurence/#findComment-323481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.