Jump to content
Larry Ullman's Book Forums

asexynerd

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by asexynerd

  1. What i meant was the 3rd and 4th pursue chapter 7 and for chapter 8 "Rewrite the password conditionals found in register.php as a nested pair of conditionals. Hint: See Chapter 6 for examples."
  2. here is part b for pursu chapter 7 for MD array <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Chapter 7 pursu</title> </head> <body> <h2> Console Wars</h2> <?php /* pursu chapter 7 B * creating a multidimensional array */ //creating a MD array: $company = array( 1 => 'Microsoft','Nintendo', 'Sony'); $console = array( 1 => 'Xbox 360','Wii U','Playstation 3'); $firstparty = array( 1 => 'Halo', 'Mario', 'God Of War'); $best = array( 'Maker' => $company, 'System' => $console, 'mascot' => $firstparty ); print "<p>The last-gen console race begin with {$best['Maker'][1]} Xbox 360"; print "<p>The first next-gen console will be Nintento's {$best['System'][2]}"; print "<p>The most brutal first party title is Sony's {$best['mascot'][3]}"; foreach ($best as $name => $consolz){ foreach ($consolz as $game => $consoles){ print "<p>The gaming system by company, console and flagship title: $consoles\n</p>"; } } ?> </body> </html> And for C the issue I have been having with PHP is that I can read the code but up until now I struggle with constructing my own code. Can you explain that part to me and how to construct that problem?
  3. Thank you for the reply larry and thank you for explaining to me how to tackle the questions. I didn't want to start chapter 8 until I solved the purse for 7 but now since I am on ch 8 i will do both at the same time and write you the feedback.
  4. Can someone guide me step by step on how to do the pursue of chapter 7. I am having a hard time understanding it: A. Rewrite soups2.php so that it displays the number of elements in the array without using a separate variable. Hint: You’ll need to concatenatethe count() function call into the print statement. For this one do I did : //Count and print the current number of elements: print "<p>The soups array originally had " . count($soups) . " events </p>"; //Add three items to the array: $soups['Thursday'] = 'Chicken Noodle'; $soups['Friday'] = 'Tomato'; $soups['Saturday'] = 'Cream of Broccoli'; //Count and print the number of elements again: print "<p>After adding 3 more soups, the array now has " . count($soups) . " elements.</p>"; Is that right? B.Create another script that creates and displays a multidimensional array (or some of it, anyway). < Don't know what to do. C.Rewrite list.php so that it uses foreach instead of implode(), but still prints each sorted word on its own line in the browser. Also add some form validation so that it only attempts to parse and sort the string if it has a value. This is where i am stuck for C: // Turn the array back into a string: if (isset($_POST['word']) and is_array('word')){ foreach () } Some help and better understand would be greatly appreciated.
×
×
  • Create New...