Create an associative array that has at least 10 key/element pairs. а. b. Print out the array, printing out keys and values. d. Look at your array. Come up with some criterion 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)! Print out only those array elements that meet the criterion. Put the criterion in a php comment before the code so that I can see it!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
PHP
Create an associative array that has at least 10 keylelement pairs.
а.
b. Print out the array , printing out keys and values.
d. Look at your array. Come up with some criterion 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)! Print out only those array elements that meet the criterion. Put the
criterion in a php comment before the code so that I can see it!
Sort the array (using a function call
yourself!!!) Look up the sort function and the asort function
in www.php.net. Print out the sorted array in table form, printing out keys
and values.
do not write the sorting code
--
е.
comman
unset the fourth element in the sorted array (use the unset function, look it
up on www.php.net)
g. Print out the reverse sorted array in table form, printing out keys and
values. Look up rsort and arsort on www.php.net
h. Print out the array sorted by KEY value in table form, (look up other sort
functions) printing out keys and values.
use the array_rand function to print out 3 random elements of the array.
Remember that every time you refresh your page, these will be different
j. Add 5 new elements to the array and print them out again
f.
i.
Transcribed Image Text:Create an associative array that has at least 10 keylelement pairs. а. b. Print out the array , printing out keys and values. d. Look at your array. Come up with some criterion 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)! Print out only those array elements that meet the criterion. Put the criterion in a php comment before the code so that I can see it! Sort the array (using a function call yourself!!!) Look up the sort function and the asort function in www.php.net. Print out the sorted array in table form, printing out keys and values. do not write the sorting code -- е. comman unset the fourth element in the sorted array (use the unset function, look it up on www.php.net) g. Print out the reverse sorted array in table form, printing out keys and values. Look up rsort and arsort on www.php.net h. Print out the array sorted by KEY value in table form, (look up other sort functions) printing out keys and values. use the array_rand function to print out 3 random elements of the array. Remember that every time you refresh your page, these will be different j. Add 5 new elements to the array and print them out again f. i.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education