Online Shopping : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

7 of 12 people (58%) answered Yes
Recently 5 of 9 people (56%) answered Yes


I want some while cycle in one script to call (x-times) the other script and give him the values of variables (which are each time other).

Jul 6th, 2009 10:57
khalid khalid, chat alarab, haytham ali, dman, Mirko Nasato, lukas novak,

You cannot strictly pass variables to another script, but you can set
those variables in the main script and then include() the other script.
for ($i = 1; $i <= 5; $i++) {
    $passed = "Line $i.";
echo "$passed\n";
$ php -f main.php
Line 1.
Line 2.
Line 3.
Line 4.
Line 5.