<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>HTML5 Form Example</title>
</head>
<body>
	<?php
	error_reporting(E_ALL);
	foreach ($_POST as $key=>$value){
		if (is_array($value)){
			foreach ($value as $arrayvalue){
		      $arraycontent .= $arrayvalue.',';
	       }
	      echo '<strong>'.ucfirst($key).'</strong>: '.$arraycontent.'<br>';
		}
		else if($key == 'submit'){
			continue;
		}
		else {
		echo '<strong>'.ucfirst($key).'</strong>: '.$value.'<br>';
		 }
    }
	}



	//we needed to loop through the hobby array.
	



	//extract data and print it
	?>
	<form action="form.php" method="post">
	<input type="text" name = "firstname" placeholder="Enter Your Full Name"><br/>
	<input type="radio" name ="gender" value="male"/>Male<br>
    <input type="radio" name ="gender" value="female"/>Female<br>
    <select name = "yearinschool">
    	<option value="Freshman">Freshman</option>
    	<option value="Sophomore">Sophomore</option>
    	<option value="Junior">Junior</option>
    	<option value="Senior">Senior</option>
    </select><br>
    <input type="checkbox" name="hobbies[]" value="Football"> Football<br>
    <input type="checkbox" name="hobbies[]" value="Hockey"> Hockey<br>
    <input type="checkbox" name="hobbies[]" value="Baseball"> Baseball<br>
    <textarea name="comments"></textarea>


	<input type ="submit" name = "submit" value="Submit Data">
	</form>
</body>
</html>