I got the following class and I want to know if it is possible to use a variable array name.
class Ajax{
private $method;
public function __construct(){
$this->method = '$_' . $_SERVER['REQUEST_METHOD'];
}
}
So basically the $method variable should either contain the POST or GET method, next question is also if it is smart to use a reference here?
My first thought was:
$this->method = '$_' . $_SERVER['REQUEST_METHOD'];
$this->metod =& $$this->method;
But that is not working.
Thanks for reading and help, much appreciation.
$_POST
or$_GET
to$this->method
? – xdazz Feb 13 '12 at 14:16