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

:Q: PLEASE WRITE A PHP FUNCTION FOR THE FOLLOWING : Function: sortHash2

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!