RE: [PHP] Variable variables question?
| From: | Douglas Douglas | Date: | Fri, 13 Jun 2003 23:57:22 +0000 |
| Subject: | RE: [PHP] Variable variables question? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151442@lists.php.net to get a copy of this message | ||
Thanks for the answer Mike.
Thanks for the explanation, but I think this is a
different case, isn't? I'm not trying to do this
${$_POST}, I'm trying to make this string $_POST.
And I have another question. Why does this code work?
<?php
echo '<pre>';
print_r($_POST);
echo '</pre><br><br>';
$method = 'POST';
$data = ${'_'.$method};
echo '<pre>';
print_r($data);
echo '</pre><br><br>';
?>
It does what I want it to do. I use it as the action
of the same form I submitted before and it does print
the superglobal array twice. The difference between
this code and the one that doesn't work is that the
latter is a class method.
What do you think? Thanks again.
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com