<!DOCTYPE html>
<html>
<head>
	<title>PHP Loop Through An Array of Articles</title>
</head>
<body>
<?php
/*
Write a function named createArticleList.
The function should take an array of articles as a parameter 
(use the $all_articles array below)
The function should return a STRING that represents an HTML ordered list.
The string should start and end with "<ol>" and "</ol>" respectively.
In between the OL tags, loop through the parameter and concatenate an LI element onto the string.
Each LI element should display the article title.
HINT: To concatenate a string onto the end of another string use .= in PHP (not +=)

After you write the code for the function, try it out by invoking it and echo out the returned string.
*/

$all_articles = [
	["title" => "Array Methods - Map, Reduce, and Filter", "author" => "Joe Zimmerman"],
	["title" => "Arrow Functions", "author" => "Christian Bonilla"],
	["title" => "Conditional Operator and Checking for Null", "author" => "Harmony Maves"]
];

function createArticleList($articles){
	echo("<ol>");

	for($i=0; $i < count($articles); $i++){
		echo("<li>");
		echo($articles['title']);
		echo("</li>");
	}

	echo("</ol>");
}


createArticleList($all_articles);
?>
</body>
</html>