Question: Q.1. Write a PHP script to sort the given associative array: array(Nestl=>ToffeeCrisp, NutRageous=>Hershey, Cadbury=>Bournville, KraftFoods=>Toblerone) a) ascending order sort by value b) descending order sorting
Q.1. Write a PHP script to sort the given associative array:
array("Nestl"=>"ToffeeCrisp", "NutRageous"=>"Hershey", "Cadbury"=>"Bournville", "KraftFoods"=>"Toblerone")
a) ascending order sort by value b) descending order sorting by Key Hints: krsort( ), asort( ), foreach($array as $key=>$value).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
