$arr = eval(\"array(\'foo\'=>\'bar\');\"); // returns null var_dump($arr);
Can someone please explain why did I get null instead of an array?>
Did you mean
eval("\$arr = array('foo'=>'bar');"); var_dump($arr);