rsort() - Sort array in descending alphabetical order


SUBMITTED BY: henry1874w

DATE: June 17, 2017, 1:12 p.m.

FORMAT: Text only

SIZE: 227 Bytes

HITS: 218

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. $cars = array("Volvo", "BMW", "Toyota");
  6. rsort($cars);
  7. $clength = count($cars);
  8. for($x = 0; $x < $clength; $x++) {
  9. echo $cars[$x];
  10. echo "<br>";
  11. }
  12. ?>
  13. </body>
  14. </html>

comments powered by Disqus