我在这样的字符串中存储了php代码((数组定义))
$code=' array(
0 => "a",
"a" => $GlobalScopeVar,
"b" => array("nested"=>array(1,2,3)),
"c" => function() use (&$VAR) { return isset($VAR) ? "defined" : "undefined" ; },
); ';
Run Code Online (Sandbox Code Playgroud)
有一个正则表达式来提取这个数组?? ,我的意思是我想要类似的东西
$array=(
0 => '"a"',
'a' => '$GlobalScopeVar',
'b' => 'array("nested"=>array(1,2,3))',
'c' => 'function() use (&$VAR) { return isset($VAR) ? "defined" : "undefined" ; }',
);
Run Code Online (Sandbox Code Playgroud)
pD ::我做研究试图找到一个正则表达式但没有找到.
pD2 :: stackoverflow的神,让我现在赏金,我将提供400:3
pD3 ::这将用于内部应用程序,我需要提取一些PHP文件的数组,以部分'处理',我尝试用这个codepad.org/td6LVVme解释