#!/usr/local/bin/php -f<?php /* $Id: reversefile.php,v 1.1 2001/05/08 04:18:33 doug Exp $ http://www.bagley.org/~doug/shootout/ */ $fd = fopen("php://stdin", "r"); $lines = array(); while (!feof ($fd)) { array_push($lines, fgets($fd, 4096)); } fclose($fd); foreach (array_reverse($lines) as $line) print $line; ?>