On Thursday 26 June 2003 19:25, Dore van Hoorn wrote:

[snip]

> # i would like a function that pushes this word into a second array.
> # before pushing, it has to check whether or not the same word is already
> in the array.
> # if it is: do not push word into array, but add "1" to the number of
> occurrences of that word
> # if it is not: push this new word into array
> # all of this has to result into a word - frequency array (content analysis
> of free text)
> # question 1: how do i produce such an array?
> # question 2: how do i get the two elements (word and number of
> occurrences)
>
> # together out of the array and print them to the screen?
> # f.e.: the word "computer" occurred two times in this text.
>
> }

Would array_count_values() be of any use?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
And furthermore, my bowling average is unimpeachable!!!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to