Hi, I am facing a strange problem with curl. I am fetching two different URLs on a single page with curl in two different functions. The 1st function returns proper data but the 2nd doesn’t return anything. If I comment out the 1st function then the 2nd one works nicely. I have pulling out my hair for over 3 hours now and I need your help…
[code]<?php
$feed_uri = ‘http://www.my_server.com/mk/favicons/filename.php?feed=’.urlencode(‘http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-M2.5.xml’);
$favicon = getFaviconName($feed_uri); //This will return the favicon address for the feed. Something like http://www.santabanta.com/favicon.ico This function is working fine and returns the url properly.
preg_match(’/[^.]+$/’, $favicon, $matches);
$mime = ‘bmp’;
if ($matches[0] == ‘ico’) {
$mime = ‘x-icon’;
} else {
$mime = $matches[0];
}
header(‘Content-type: image/’.$mime);
echo renderFavicon($favicon); //This will fetch the image and then spit it out to the browser. This is not working, it just renders nothing. If I comment out the getFaviconName function call from above and directly pass the icon url then it works fine.
?>