gjhuerte / ibinex-prototype

User Interface made by Team II
MIT License
1 stars 0 forks source link

Own Sorting Function #34

Closed ghost closed 6 years ago

ghost commented 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");