Kendi sort fonksiyonumu php ile nasıl yazarım?<?php
$inputwords = array("whichever","word","is","the","longest","will","appear","at","the","top");
usort($inputwords, "sortlen");
print_r($inputwords);
function sortlen($a,$b) {
$lena = strlen($a);$lenb = strlen($b);
if ($lena == $lenb) return 0;
return ($lena > $lenb) ? -1 : 1;
}
?>Array ( [0] => whichever [1] => longest [2] => appear [3] => word [4] => will [5] => top [6] => the [7] => the [8] => at [9] => is )