3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $path = 'categories_1_sub_010_subsub_42_field'; echo preg_replace('/_(\d+)_/', '[$1].', $path);
Output for 4.3.0 - 7.2.0
categories[1].sub[010].subsub[42].field