3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "abc(xxx@email.com);cde(ggg@gmail.com)"; Preg_match_all('/(\w+)\((.*?)\)/', $str, $match); $emails = array_combine($match[2], $match[1]); Var_dump($emails);
based on 06Z12
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0rc3
array(2) { ["xxx@email.com"]=> string(3) "abc" ["ggg@gmail.com"]=> string(3) "cde" }