-   Programming (
-   -   bash result to PHP (

eco 05-18-2009 01:53 PM

bash result to PHP
Hi all,

I was wondering if any of you had an idea on how to do the following:


for i in `whatever the result is`; do
  php thePhpScript.php $i

so what I am trying to do is send the result of the for loop as a variable (equivalent to $1 in bash) to my PHP program.

Can this be done?

colucix 05-18-2009 02:47 PM

In a PHP script the first argument is

whereas $argv[0] is the name of the script itself.

eco 05-18-2009 03:33 PM

Fab, seems to get the bash variable... now I can have fun trying to use it properly ;)

Thanks mucho!

ghostdog74 05-18-2009 06:50 PM

why not gather everything into a variable, then pass to php once...?

php phpscript.php $whatever

All times are GMT -5. The time now is 05:18 AM.