I am going through some book examples and just can't understand why one example works the way it does. In this example an array is passed to a function. The function then creates a table containing all elements on separate lines. My question is how does reset work in this function? In my logic, when reset resets $data, the array is returned to the first element and the table should endlessly show the first element only. Just seeing the results in the browser I know this is not true. But why?

```
<?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>";
    }
?>

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

```