<?php 
$test = array(1, 2, 2, 2, 3, 3);

if(count($test)==0){
	echo 'No elements here';
}

elseif(count($test)==1){
	echo $test[0];
}

else{
//sort($test);
$result=array_unique($test);
echo $maximal= array_pop($result);
echo $maximal= array_pop($result);
}