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:
- Remove all the elements from the array which repeat.
- Order the output array in such manner that the element which occured most in the input array is on top.