fork(3) download
  1. <?php
  2.  
  3. $str = '<p>Hello World!</p><p style="text-align:center"><img src="foo.png" /><br /></p>';
  4. $lines = explode( '|', str_replace('><', '>|<', $str));
  5. print_r($lines);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => <p>Hello World!</p>
    [1] => <p style="text-align:center">
    [2] => <img src="foo.png" />
    [3] => <br />
    [4] => </p>
)