I'm aware that the following piece of code is possible in php:
$dog = 'Woof!';
$cat = 'Miauw!';
$animal = 'dog';
var_dump($$animal);
Output: 'Woof!'
Of course this is a simplified example of my actual code, nonetheless you get the idea.
Now I can't seem to get the $_POST variable to act the same way.
Example:
$method = '_POST';
$$method['password'] = array();
// In the end i would want this piece of code above to do what i typed below
$_POST['password'] = array();
Output: 'Notice: Undefined variable: _POST'
So does this mean it is not possible to call $_POST this way or am I doing it the wrong way?
$$syntax is bad news. It's not quite as bad aeval()but it's a pretty close second. Please try to avoid it -- there's always a better solution than this.