Jump to content

sorting array by duplicates?


emma57573

Recommended Posts

Is there a command that I can place before this array command

 

   for($i=0;$i<count($taggy);$i++){
			$tagunique = array_unique($taggy);

		     

		   }//end while

 

That sorts the array with the highest duplicate values first.

 

So the array would order like this

 

test

test

test

test

testing

testing

testing

tag

tag

array

tagarray

 

Instead of all over the place

 

Then when I run my command to pick out the unique values it will run it in the correct order? With the most popular values first like:

 

test

testing

tag

array

tagarray

 

Does that make sense?

 

 

Link to comment
https://forums.phpfreaks.com/topic/134746-sorting-array-by-duplicates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.