PHP bash command line stdin

Content

Read stdin using php on the command line.

listdir () {     ls | sort | php -r '         while ($line = fgets(STDIN)) {             $filename = rtrim($line);             $modified = date(DATE_W3C, filemtime($filename));             echo "$modified $filename\n";         }     ' }