3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/,\s?/'; $filenames = 'filename.png,filename.png,filename.png,filename.png,file name.png'; var_dump(preg_split($pattern, $filenames)); $filenames = 'filename.png, filename2.png, filename3.png, filename4.png, file name5.png'; var_dump(preg_split($pattern, $filenames));

preferences:
54.03 ms | 405 KiB | 5 Q