I'm struggling with variable variables in PHP. I have the following piece of code.
if($_GET["action"] == 1){
$action = "_GET";
}else{
$action = "_POST";
}
...
${$action["lang_id"]}
I get the following errors:
- Illegal string offset "lang_id" (but if I use directly the $_GET name it works properly)
- udefined variable _ (yes, an underscore).
thanks in advance