Question
NOTE: PUT THE PRINTING OF THE TABLE IN A FUNCTION!!! Then call the function as many times as necessary to complete the tasks below. Declare
NOTE: PUT THE PRINTING OF THE TABLE IN A FUNCTION!!! Then call the function as many times as necessary to complete the tasks below.
Declare a one dimensional associative array that has at least 8 key/element pairs.
Print out the array in a table (use html
Handle (Username) | Tweets | Number of Followers | Following |
joeDoe | 20000 | 45 | 8 |
JohnD | 62000 | 123 | 160 |
computerSavy | 75 | 1 | 25 |
myTwitterAccount | 1800 | 15 | 6 |
Print out the array sorted by tweets (ascending)
Print out the array sorted by followers (ascending)
Print out only users who have followers > 10, sorted by followers in descending order.
Add a form to your php file that has a user put in a Username with the method post. If the name exists in the array, do nothing. If the name does not, add an element to the array with the Username and all other values set to 0. Print out the new array.
EXTRA CREDIT: The way the assignment is set up above, you can add one person but the array otherwise stays the same. If you then post again, it will start off with the old original array. For extra credit, use a hidden element in the form that allows a user to keep adding new users. See: http://www.pontikis.net/tip/?id=11
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started