3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $content = "11:12:12:test titel 1\n 12:13:13:test titel 2\n 13:14:14:test titel 3"; $arr = preg_split("/(:|\n)/" ,$content); var_dump($arr);
based on mAa6r
Output for 5.6.0 - 7.3.0alpha1
array(14) { [0]=> string(2) "11" [1]=> string(2) "12" [2]=> string(2) "12" [3]=> string(12) "test titel 1" [4]=> string(0) "" [5]=> string(2) "12" [6]=> string(2) "13" [7]=> string(2) "13" [8]=> string(12) "test titel 2" [9]=> string(0) "" [10]=> string(2) "13" [11]=> string(2) "14" [12]=> string(2) "14" [13]=> string(12) "test titel 3" }