Closed ghost closed 6 years ago
Fill in the blanks.
Make your own sorting function.
function my_sort($x,$y){
if BLANK; <-----ANSWER: ($x == $y) return 0
return BLANK; <------ANSWER: ($x < $y) ? -1 : 1; }
$a = array('a','b','c');
usort($a,"my_sort");
Fill in the blanks.
Make your own sorting function.
function my_sort($x,$y){
if BLANK; <-----ANSWER: ($x == $y) return 0
return BLANK; <------ANSWER: ($x < $y) ? -1 : 1; }
$a = array('a','b','c');
usort($a,"my_sort");