PHP Array Sort
Last modified: July 18, 2021<?php
$age = array("Tom"=> 50, "Chris" => 40, "Mat"=>23);
ksort($age); //ascending by key
print_r ($age);
sort($age);
print_r($age); //ascending by value
krsort($age); //descending by key
print_r ($age);
arsort($age);
print_r($age); //descending by value
?>