Question: Q: PLEASE WRITE A PHP FUNCTION FOR THE FOLLOWING : Function: sortHash2 Parameter(s): Associative Array, code Write a PHP function to accept an associative array
Q: PLEASE WRITE A PHP FUNCTION FOR THE FOLLOWING
:
Function: sortHash2 Parameter(s): Associative Array, code Write a PHP function to accept an associative array (as follows) and a code as input parameters, and then sort the input associative aray as follows. Example of the input array array("Jack"->"55" , Anita''-?"30'' ''Ramesh" >"40". "Sophia" >"21 ""Nastran" >"41 ","William" ,"39" "Davi d"->"5") in a) if code -1: ascending order sort by value b) if code -2: ascending order sort by Key c) if code -3: descending order sorting by Value d) if code-4: descending order sorting by Key e) For other values of code: Function only prints ("Wrong Code")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
