<!DOCTYPE html>
<html>
<head>
	<title>PHP Arrays Coding Challenge</title>
	<style type="text/css">
		body{ margin:20px; font-family: verdana }
		div{ background-color: lightgray; padding:25px; }
	</style>
</head>
<body>
	<h1>PHP Arrays Coding Challenge</h1>
	
	<h2>Problem 1</h2>
	<p>
		Add PHP code inside the DIV below this paragraph.
		The code should declare and initialize an array of strings with the following elements in it: <b>Apples, Oranges, Bananas</b>.
		Then loop through the array and echo each element.
	</p>
	<div>
	<?php
$fruitsArray = array('Apples','Oranges','Bananas');
foreach ($fruitsArray as $x){
	echo($x . "<br>");
}
?>
	</div>

	<h2>Problem 2</h2>
	<p>
		Add PHP code inside the DIV below.
		The code should declare and initialize an associative array that has the following key/value pairs in it:
	</p>
	<pre>
<b>KEY             VALUE</b>
------------------------
firstName       Bob
lastName        Smith
age             25
	</pre>
	<p>
		Then loop through the array and echo each key and value.
	</p>
	<div>
	<?php	
	$peopleArr = array(
		'firstName' => "Bob",
		'lastName' => "Smith",
		'age' => 25
	);

	foreach($peopleArr as $key => $value){
		echo("{$key}: {$value} <br>");
	}
	?>
	</div>
	
	<h2>Problem 3</h2>
	<p>
		In the DIV below this paragraph, echo the value of the lastName from the array that you created in the previous problem.
	</p>
	<div>
		<?php
		//for($peopleArr){
		//echo();
		//}
		?>
	</div>
</body>
</html>