> -----Original Message-----
> From: Nick Wilson [mailto:[EMAIL PROTECTED]]
> Sent: 23 May 2002 17:32
>
> I've been looking at the php manual section on variable
> variables but I
> don't think i either a) understand it, or b) it isn't what I need.
>
> Here's the coup:
>
> I have a bunch of post vars, lets say $red, $green and $blue
> I want to loop through the post vars and create a variable callled
> $file_red, $file_green and $file_blue
Try this (untested!):
foreach($_POST as $key=>$value):
${"file_$key"} = $value;
endforeach;
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php