[PHP] counting ocuring words in a string

2005-05-17 Thread Merlin
Hi there, I am trying to find a way to count the number of times (if any) words are inside a string. So I played around with ereg, preg_match_all and so on, but could not put together a working code. Can anybody help me on that? This is the current code: function count_words($str, $words) {

Re: [PHP] counting ocuring words in a string

2005-05-17 Thread Petar Nedyalkov
On Tuesday 17 May 2005 13:00, Merlin wrote: Hi there, I am trying to find a way to count the number of times (if any) words are inside a string. So I played around with ereg, preg_match_all and so on, but could not put together a working code. Can anybody help me on that? This is the

Re: [PHP] counting ocuring words in a string

2005-05-17 Thread Brian V Bonini
On Tue, 2005-05-17 at 06:00, Merlin wrote: Hi there, I am trying to find a way to count the number of times (if any) words are inside a string. So I played around with ereg, preg_match_all and so on, but could not put together a working code. Maybe something like this? ?php $words =

Re: [PHP] counting ocuring words in a string

2005-05-17 Thread Jason Wong
On Tuesday 17 May 2005 18:00, Merlin wrote: I am trying to find a way to count the number of times (if any) words are inside a string. explode() array_count_values() -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting *