3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stylestr = 'text-align:center;display:block;'; $_style = array(); preg_match_all('#(.*?):(.*?);#', $stylestr, $matches); foreach($matches[1] as $index => $key) $_style[$key]=$matches[2][$index]; //$_style = array_combine($matches[1], $matches[2]); var_dump($_style);
based on MUWf8
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { ["text-align"]=> string(6) "center" ["display"]=> string(5) "block" }