<?php $str = <<<'EOD' #1 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? #2 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? #3 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? a) dfk EOD; print_r(preg_split('~(\R+|^#\d+$)+(?=\(\d+\)|[a-z]\)|\z)~m', $str, -1, PREG_SPLIT_NO_EMPTY));
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`