Passing arguments to php script

i want to be able to pass arguments to a php script if it is being piped:

cat myphpscript.php | php - $1 $2 $3 blah blah

This usually works for other script languages...i.e. ruby:

cat myrubyscript.rb | ruby - $1 $2 $3 blah blah

so my question is, how can i pass arguments to my php script if im piping it?

That's the way how this is be done:

someprogram_that_creates_php_code_on_stdout | php -- $1 $2 ...

Had to use google too, to find out how it is done....

1 Like