- array_search: documentation ( source)
- print_r: documentation ( source)
- in_array: documentation ( source)
- max: documentation ( source)
<?php
$array = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 );
$arrays = $array;
//print_r($array);
$i=1;
foreach($arrays as $key=>$values)
{
echo "\n".max($array)." rank is ". $i."\n";print_r($array);
$keys = array_search(max($array), $arrays);
unset($array[$keys]);
if(!in_array(max($array),$array))
$i++;
}