1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4. <head> 5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 6. <title>No Soup for You!</title> 7. </head> 8. <body> 9. <h1>Mmm...soups</h1> 10. <?php // Script 7.2 - soups2.php 11. /* This script creates and prints out an array. */ 12. // Address error management, if you want. 13. 14. // Create the array: 15. $soups = array ( 16. 'Monday' => 'Clam Chowder', 17. 'Tuesday' => 'White Chicken Chili', 18. 'Wednesday' => 'Vegetarian' 19. ); 20. 21. // Count and print the current number of elements: 22. $count1 = count ($soups); 23. print "<p>The soups array originally had $count1 elements.</p>"; 24. 25. // Add three items to the array: 26. $soups['Thursday'] = 'Chicken Noodle'; 27. $soups['Friday'] = 'Tomato'; 28. $soups['Saturday'] = 'Cream of Broccoli'; 29. 30. // Count and print the number of elements again: 31. $count2 = count ($soups); 32. print "<p>After adding 3 more soups, the array now has $count2 elements.</p>"; 33. 34. // Print the contents of the array: 35. print_r ($soups); 36. 37. ?> 38. </body> 39. </html>