added <?php so you can just run "php index.php > filename.php"