``` $array = array(5, 3, 7, 1); sort($array); print join(", ", $array); // prints "1, 3, 5, 7" ``` ``` PHP also has the opposite function:`rsort()`. ``` ``` $array = array(5, 3, 7 ,1); rsort($array); print join(":", $array); // prints "7:5:3:1" ``` ``` Lastly, we use `join(glue, array)` so we can easily print out the representations of our sorted arrays in this exercise. For this exercise, we'll use a comma (`,`) as the glue.
``` $array = array(5, 3, 7 ,1); rsort($array); print join(":", $array); // prints "7:5:3:1" ``` ``` Lastly, we use `join(glue, array)` so we can easily print out the representations of our sorted arrays in this exercise. For this exercise, we'll use a comma (`,`) as the glue.
校長室 教務處學務處總務處輔導室家長會媒體報導 北小臉書北小附幼臉書課程計畫平台