3v4l.org

run code in 150+ 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 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0