([^<]+)@Ui'; $wholepage = file_get_contents($url); preg_match_all($regex, $wholepage, $matches, PREG_SET_ORDER) or die; header("Content-type: application/xml"); echo ''; echo ''; echo " \n"; echo " Example.com\n"; echo " $url\n"; echo " List of blogs at example.com\n"; echo " en-us\n"; foreach ($matches as $match) { $link = htmlentities($match[1]); $title = htmlentities($match[2]);; echo " \n"; echo " $title\n"; echo " $link\n"; echo " $title\n"; echo " \n"; } echo " \n"; echo "\n"; ?>