Re: twodimensional array / word-frequencylist
| From: | David Nicholson | Date: | Thu, 26 Jun 2003 11:46:08 +0000 |
| Subject: | Re: twodimensional array / word-frequencylist | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152961@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Thu, 26 Jun 2003 at 12:36,
lines prefixed by '>' were originally written by you.
> foreach($words as $thisword){
> if(in_array($thisword, $array)){
> $array[$thisword]++;
> } else {
> $array[$thisword]=1;
> }
Just realised my own mistake...
The if statement shoud be if(isset($array[$thisword])) as the word is the
key and not a value in the array.
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)