I have an array like this.
$array = array(
'Element1',
'Element2',
'Element3',
'Element1',
'Element1',
'Element4',
'Element4',
'Element2',
'Element2',
'Element2',
'Element2',
'Element4',
'Element5',
'Element5' );
I want an array like this as output.
$output = array('Element2' , 'Element1', 'Element4', 'Element5', 'Element3');
So, what i want is:
Use array_count_values() and sort()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With