3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = <<<TXT First chunk doesn't start with any delimiter. ****** Second chunk is separated from the first one by six asterisks plus a carriage return. ****** Third chunk is separated from the second one by six asterisks plus a carriage return. ****** And son on... and on. ****** But we might find other asterisks, maybe six like ****** inside the paragraph, and those one are not to be split. Same for new lines without ****** which should stay the same. TXT; var_export( preg_split('/\R*^\*{6}$\R*/m', $txt, 0, PREG_SPLIT_NO_EMPTY) );
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
array ( 0 => 'First chunk doesn\'t start with any delimiter.', 1 => 'Second chunk is separated from the first one by six asterisks plus a carriage return.', 2 => 'Third chunk is separated from the second one by six asterisks plus a carriage return.', 3 => 'And son on... and on.', 4 => 'But we might find other asterisks, maybe six like ****** inside the paragraph, and those one are not to be split. Same for new lines without ****** which should stay the same.', )

preferences:
118.91 ms | 408 KiB | 5 Q