I have built a php function to print the name of a person entered into my array, but it is not printing the names, it is only print the word . Please let me know if you can assist me with this.
<?php
$names = array(0 => array(name =>"Becky", email => "@hotmail.com"),
1 => array(name =>"Tom", email => "@yahoo.com"),
2 => array(name => "Milduew", email => "@google.com")
);
function printInfo() {
echo "<table>";
foreach((array) $names as $name){
echo "<tr><td>" . $name[0]. "</td>";
echo "<td>" . $name[1]. "</td>";
echo "<td>" . $name[2]. "</td></tr>";
echo"</table>";
}
}
printInfo();
?>