Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 1.12 KB

0276.md

File metadata and controls

53 lines (45 loc) · 1.12 KB

You have been given the following PHP script:

<?php
if ($_POST) {
   echo '<pre>';
   echo htmlspecialchars(print_r($_POSTtrue));
   echo '</pre>'; 
} 
?> 
<form action="action.php" method="post">
   Name:  <input type="text" name="personal[name]" />
   Email: <input type="text" name="personal[email]" />
   Code: 
   // ???
   <option value="A">A</option>
   <option value="B">B</option>
   <option value="C">C</option>
   </select> 
   <input type="submit" value="submit me!" />
</form>

Which of the following is the correct syntax that should be used in line number 10 to capture all of the data from the user in PHP?

  • A)
<select multiple name="select_box[]">
  • B)
<select multiple name="select_box=array()">
  • C)
<select multiple name="select_box[multiple]">
  • D)
<select multiple name="select_box">
Answer

Answer: A