diff options
-rwxr-xr-x | urldecode | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,10 +1,12 @@ #!/usr/bin/php <?php -if (count($argv) == 0) { +if (count($argv) == 1) { echo urldecode(file_get_contents("php://stdin")); } else { - foreach ($argv as $arg) { + $args = $argv; + unset($args[0]); + foreach ($args as $arg) { echo urldecode(file_get_contents($arg)); } } |