This version is probably best suited to use in a console (command line) or something.
To make this work at the unix command line, add #!/usr/bin/php as the very first line and chmod +x the script. This assumes /usr/bin/php is where your php exe is.
Of course youll have to edit it a fair bit to get the output nice for the console :)