Function looping help

I have created a function that accepts two arguments a first and last name. the function returns the initials in a single string. i need to call the above function 5 times, passing in 5 different names and print the value returned each time. i cant figure out how to loop the function 5 times so the user can enter a different name each time and it print out each of the five names’ initials. heres what i have so far.
index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Functions!</title>
</head>
<body>
<p>Please enter your first and last name so I can 
give you your initials.</p>

	<form action="functions.php" method="post">
	<p>First Name: <input type="text" name="first_name" size="20" /></p>
	<p>Last Name: <input type="text" name="last_name" size="20" /></p>
	<input type="submit" name="submit" value="Get My Initials" />
	</form>
	
	
</body>
</html>

functions.php

<?php

function first_and_last($first_name, $last_name ) {
    return $first_name[0] . '. ' . $last_name[0] . '.';

	}
echo first_and_last($_POST['first_name'], $_POST['last_name']);
?>

This is basic control structure knowledge.

http://php.net/manual/en/control-structures.for.php

I highly advise you read that entire section. PHP shares it’s control structure syntax with several major languages, so learning this will serve you well.

okay, i have the code that allows the user to input the five names and it runs through and gives the initials, but it also returns extra f and l letters for each of the names if i put kayla norris, it returns fkln instead of kn, i can’t seem to find the error. heres the code i have so far.
index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Functions!</title>
</head>
<body>
<p>Please enter your first and last name so I can 
give you your initials.</p>

<form action="functions.php" method="post">
<?php
for ($i = 0; $i < 5; $i++)
{
    
    print '<legend>Enter Name</legend>';
    printf('<label for="first_name%d">First Name:</label>', $i);
    printf('<input id="first_name%d" type="text" name="name[][first]" size="20" />', $i);
    printf('<label for="last_name%d">Last Name:</label>', $i);
    printf('<input id="last_name%d" type="text" name="name[][last]" size="20" />', $i);
    print '</fieldset>';
}
?>
<input type="submit" name="submit" value="Get My Initials" />
</body>
</html>

functions.php

<?php
if (isset($_POST['name']) && is_array($_POST['name']))
{
    foreach ($_POST['name'] AS $fullname)
    {
        list($first, $last) = each($fullname);
        print first_and_last($first, $last);
    }
    echo '<br/>';
}
function first_and_last($first_name, $last_name ) {
    return (!empty($first_name) && !empty($last_name)) ? $first_name[0] . '. ' . $last_name[0] . '.' : '';
}
?>