Entry
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).
Feb 19th, 2008 22:12
dman, Mirko Nasato, lukas novak, http://www.ttnr.org
You cannot strictly pass variables to another script, but you can set
those variables in the main script and then include() the other script.
main.php:
<?php
for ($i = 1; $i <= 5; $i++) {
$passed = "Line $i.";
include('other.php');
}
?>
other.php:
<?php
echo "$passed\n";
?>
$ php -f main.php
Line 1.
Line 2.
Line 3.
Line 4.
Line 5.