Re: [PHP] Re: keywords generation (ANOTHER)

2004-11-05 Thread Bruno B B Magalhães
Hi, I am trying to categorize the keywords... for example, if a word shows at the begin probably it´s more important, but how many occurrences is also important... Does someone knows Google´s formula? hehe This code is working more or less as expected! Many Thanks, Bruno ==

Re: [PHP] Re: keywords generation

2004-11-05 Thread Bruno B B Magalhães
Finally a solution for those who needs! :) ==FUNCTION== function generate_keywords($text,$number=10) { $iwords = array('a', 'to', 'of', 't', 'e' ); if(isset($text) && $text != '' && $text=strtolower($text)

Re: [PHP] Re: keywords generation

2004-11-05 Thread M. Sokolewicz
use a simple: asort($total, SORT_NUMERIC); $total will hold the correct array with the most common word at the top, and the least common at the bottom. (just a quick question, why're you using latin? :P) > Hi, > > no problem at all... > > well, the script is incomplete cause I don´t know how to

Re: [PHP] Re: keywords generation

2004-11-05 Thread Bruno B B Magalhães
Hi, no problem at all... well, the script is incomplete cause I don´t know how to sort the $total array by value... for example: Array ( [Lorem] => 1 [ipsum] => 1 [dolor] => 5 [sit] => 1 [met] => 1 [consectetuer] => 1 [dipiscing] => 1 [elit] => 2 [sed] => 1

[PHP] Re: keywords generation

2004-11-05 Thread M. Sokolewicz
Bruno b b magalhães wrote: Hi People, well, I am building a very sophisticated(?) CMS, and I am thinking to implement a keyword automatically generation function... I thought on the following structure: == $submited_text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing eli