I need to print all matches using preg_match_all.
$search = preg_match_all($pattern, $string, $matches); foreach ($matches as $match) { echo $match[0];
Does print_r($matches) give you what you want?