.josh Posted July 11, 2009 Share Posted July 11, 2009 well I know for sure it's true for a for loop. Was thinking that also applied to a foreach loop as well. As far as regex vs. str_word_count being a bit more complex than that. Okay well then that would probably lean towards making the regex more efficient. Quote Link to comment https://forums.phpfreaks.com/topic/165600-find-most-frequent-word/page/2/#findComment-873671 Share on other sites More sharing options...
.josh Posted July 11, 2009 Share Posted July 11, 2009 I guess I was wrong. That's what I get for doubting the built-in functions! I wrote a benchmark script to compare the two and it turns out str_word_count is roughly twice as fast as the regex. Quote Link to comment https://forums.phpfreaks.com/topic/165600-find-most-frequent-word/page/2/#findComment-873681 Share on other sites More sharing options...
npsari Posted July 11, 2009 Share Posted July 11, 2009 I have a veru easy script which will find the most comon numbers in an array Then, it will echo them in order If you are after this type of come, let me know so I can find it for you I think it is somewhere in my files Quote Link to comment https://forums.phpfreaks.com/topic/165600-find-most-frequent-word/page/2/#findComment-873683 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.