Most popular word sorting
| From: | Ron Piggott | Date: | Wed, 13 Jul 2011 22:30:56 +0000 |
| Subject: | Most popular word sorting | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-314045@lists.php.net to get a copy of this message | ||
Is it possible in PHP to sort an array by most frequently occurring word / phrase, 2nd most
frequently occurring, third, etc.
An example array is:
Array ( [1] => Parable [2] => Mustard [3] => Seed [4] => Parable [5] => Good [6]
=> Samaritan [7] => Parable [8] => Workers [9] => Vineyard [10] => Parable [11] =>
Lost [12] => Sheep [13] => Parable [14] => Lost [15] => Coin [16] => Parable [17]
=> Prodigal [18] => Parable [19] => Sower [20] => Parable [21] => Weeds [22] =>
Parable [23] => Hidden [24] => Treasure [25] => Parable [26] => Parable [27] =>
Wedding [28] => Banquet [29] => Parable [30] => Virgins [31] => Parable [32] => Bags
[33] => Gold [34] => Parable [35] => Yeast )
The most popular word is “Parable”. I would like it to be the first result.
Then the second most popular word is “Lost”.
Then all the remaining words are only used once.
Ron
The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info