3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = 'r;anum;l={"5":"10"}'; $output = array(); foreach (explode(';', $input) as $part) { $count = preg_match_all('([a-zA-Z0-9]+)', $part, $matches); $output[] = ($count > 1) ? '[' . implode(',', $matches[0]) . ']' : reset($matches[0]); }
Output for 4.3.0 - 7.2.0