fork(1) download
  1. <?php
  2.  
  3. $text = "<item> foo bar foo bar <item> child item </item> </item> <item> second item <item> second child </item> </item>";
  4. preg_match_all('%<item>([^<]*)<item>%i', $text, $matches);
  5. print_r($matches[1]);
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] =>  foo bar foo bar 
    [1] =>  second item 
)