3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'products{id,name},articles{title,text}'; $arr = preg_split('/{[^{}]*}\K,(?=\w)/', $string); print_r($arr);

preferences:
64.22 ms | 405 KiB | 5 Q