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 elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. ';
generate_keywords($submited_text);
function generate_keywords($text) { if(isset($text) && $text != '') { $words_to_ignore = array('/a/', '/to/', '/of/', '/from/' );
$words = str_word_count(preg_replace($words_to_ignore,'',$text),1);
foreach($words as $var=>$val) { $total[$val] = substr_count($text,$val); } } } =================
How can I sort the resulting array by value, without loosing its relations.
Is there a faster way of doing this?
Regards, Bruno B B Magalhaes
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php