Can someone please take the time to step me through this simple code?
I can understand most of it, but the $data used as an array is throwing me. It doesn’t appear to be assigned any values therefore the reset($data) doesn’t make sense to me.
Cheers for the input!
<?php
function create_table($data) {
echo '<table border=\'1\'>';
reset ($data);
$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);
?>