Re: [PHP] Extract from string, version 3.0

2001-04-14 Thread Steve Edberg
Sheesh! No one should let me reply to email without sufficient caffiene! Now, I actually just read and grokked your question... I haven't tested this. And, I included a line that removes apostrophes (eg; "steve's" becomes "steve"). You can comment that line out if this doesn't suit your needs.

Re: [PHP] Extract from string, version 2.0

2001-04-14 Thread Steve Edberg
OK, this is less elegant (to me, anyway), and probably a bit slower, but: function word_occurrence($word,$phrase) { $word = strtolower($word); # this way, $phrase = strtolower($phrase); # case is irrelevant $Bits = split('[^[:alnum:]]+', $phrase); $count = 0; for ($i=0; $

Re: [PHP] Extract from string

2001-04-14 Thread Steve Edberg
At 11:07 PM +0200 4/14/01, n e t b r a i n wrote: >Hi all, >anyone have or know where I can find a small function in order to extract >from a string the most relevant words in it? > >something like this: > >$var="I love coffe ... Coffe is from Brazil and coffe with milk .."; >$occurence=2; >//$occ

[PHP] Extract from string

2001-04-14 Thread n e t b r a i n
Hi all, anyone have or know where I can find a small function in order to extract from a string the most relevant words in it? something like this: $var="I love coffe ... Coffe is from Brazil and coffe with milk .."; $occurence=2; //$occurence means word that are repeat 2 or more times my_dream_