i have a script that should -read a directory -grep for files with a certain prefix <int n> -create php variable called $in<n> for each match found and assign the filename to it -the variable will then be used by fopen....
is it possible to create variables on the fly witnin the while loop ? i am not using OO in php. should i?
gk
Hi, you can use $$varname syntax:
for($i=0;$i<100;$i++) { $varname="in".$i; $$varname="this is var number ".$i; }
Else you can use array...
for($i=0;$i<100;$i++) { $in[]="this is var number ".$i; }
see you