I keep getting this error
Parse error: syntax error, unexpected $end in /Applications/MAMP/htdocs/func1.php on line 43
and I have no idea why. I am new to php code so I am not sure why I am getting this. Here is my code :
<html>
<body>
<?php
$list[1] = "One";
$list[2] = "Two";
$list[3] = "Three";
$list[4] = "Four";
$list[5] = "Five";
print numbertotext(3);
print numbertotext(7);
function numbertotext($n)
{
$length = count($list[$i]);
for ($i=1; $i<$length; $i++)
{
if($n == $list[$i])
{
print($list[$i]);
}
else if ($n > 5)
{
print("Unknown");
}
else
{
$temp=$list[$i];
}
}
?>
</body>
</html>