I have multiple preg match expressions, and I'm trying to use each to output something different. I know how to use foreach to output one at a time. but how do I echo or set them a variable?
preg_match_all("/\<div class=\"merchant_info\">\s*(\<div.*?\<\/div>\s*)?(.*?)\<\/div\>/is", $res[0], $matches );
foreach($matches[0] as $titles)
{
echo "<div class='titles' >".$titles."</div>";
}
preg_match_all("/\<a class=\"thumb\"(.*?)\<\/a\>/is", $res[0], $matches);
foreach($matches[0] as $thumbs)
{
echo "<div class='thumbs' >".$thumbs."</div>";
}
I want to be able to echo the titles and thumbs together. or if i can set them as a variable and then output it somewhere else?
Thanks