Hi there,
I have a problem with variable variables. I try to do the following:
$fields[] = "email";
$required_fields[] = "_POST['{$reserved_keys[0]}']";
print $required_fields[0];
The result is _POST['email']
print $_POST['email'];
The result is the correct email address recieved from a form.
print ${$required_fields[0]};
This is where the problem occurs. The output is just blank but I thought I could get the email address like in the print command before. Isn't it possible to cascade variable variables?
register_globals is off so I cannot use the global variables but have to use $_POST.
As you can see "fields" is an array which will hold a couple of values later on and I would like to be able to process it in a loop. Therefore I need variable variables.
Cheers, 😕
Uli