Monday, February 28, 2011

Monday, Feb. 28th 2011


<?php
function create_table($data) {
echo "<table border=\"1\">";
reset($data); //Remember this is used to point to the beginning
$value = current($data);
while ($value) {
echo "<TR><TD>" . $value . "</td></tr>\n";
$value = next($data);
}
echo "</table>";
}

$my_array = array('Line one.', 'Line two.', 'Line three.');
create_table($my_array);
?>

No comments: