I want to break each paragraph into an array.
My current approach does not work:
$paragraphs = preg_split( '|</p>|', $text, PREG_SPLIT_OFFSET_CAPTURE );
How can I get from this:
$text = <<<TEXT <p>Hello!</p> <p style="border: 1px solid black;">How are you,<br /> today?</p> TEXT;
to that
$paragraphs = array( '<p>Hello!</p>', '<p style="border: 1px solid black;">How are you,<br /> today?</p>' );
html split php regex
pbaldauf
source share