1
Septembers 2015-02-06 20:09:45 +08:00
PHPPHP( https://github.com/ircmaxell/PHPPHP )
|
2
wozaimalu 2015-02-06 20:38:52 +08:00
$a = "return array('a'=>1, 'b'=>2)";
preg_match_all("/\'([A-Za-z0-9])*\'/",$a,$key); preg_match_all("/=\>([0-9])*/",$a,$value); foreach($key[1] as $k => $v) $b[$v] = intval($value[1][$k]); var_dump($b); 输出: array(2) { ["a"]=> int(1) ["b"]=> int(2) } |