Posted By

tcam27 on 07/07/11


php command line arguments

Versions (?)

Read Command Line Arguments

 / Published in: PHP

If you want to use PHP as a command line program, this code can serve s a reference to read the arguments passed to the program.

  1. <?php
  2. $i=0;
  3. while(count($argv)>$i)
  4. {
  5. echo $argv[$i] . "\n";
  6. $i++;
  7. }
  8. ?>

Report this snippet  

You need to login to post a comment.