Question: For this assignment, you will be outputting your array to a table many times so make sure you place the printing of the table into
For this assignment, you will be outputting your array to a table many times so make sure you place the printing of the table into a functionll Then call the function as many times as necessary to complete the tasks below. You can use the attached PHP file as a guide to help you complete the assignment a Create a one dimensional associative array that has at least 10 keylelement pairs b. Print out the array in a table, printing out keys and values (use html as you did in Hw 1 and as we did in class). c. Look at your array. Come up with some cnterion about elements in your array, so that about half the elements meet the criterion and half don't For example, if your elements are strings, your criterion might be ( " "kangaroo"), or if your elements are numbers, your criterion might be (> 89)l Print out only those array elements that meet the criterion. Put the criterion in a PHP comment or output it to the screen. d. Sort the array (using a function call - do not write the sorting code yourselni1) Look up the asort function in www.php. net. Print out the sorted array in table form, printing out keys and values. e. unset the fourth element in the sorted array (use the unset function, look it up on umw. phenet) f. Print out the reverse sorted array in table form, printing out keys and values, Look up arsort on wown phe.nel 9. Print out the aray sorted by KEY value in table form, (look up other sort functions) printing out keys and values h. EXIRA CREDIT use the array rand funcion to print out 3 random elomonts of the array and print them to an himt unordered ist. Rernember that every time you refresh your paje, these will be different
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
