$_POST[\'asdf\'] = \'something\'; function test() { // NULL -- not what initially expected $string = \'_POST\'; echo \'====\'; var_dump(${$string});
Look at here
Please note that variable variables cannot be used with PHP's Superglobal arrays within functions or class methods. The variable $this is also a special variable that cannot be referenced dynamically.