Code: Select all
$str = "<title>one</title><title>two</title><title>three</title><title>four</title><title>five</title>";
preg_match_all("/<title>(.*)<\/title>/i", $str, $matches, PREG_SET_ORDER) ;
foreach ($matches as $val) {
echo $val[1];
}
Since it is preg_match_all, why am i not getting the following result
one
two
three
four
five ?