Get domain favicon using PHP and Google

These days, many websites or webapps are using favicons from other websites. Displaying a favicon on your own site is pretty easy using Google and some PHP.

function get_favicon($url){
  $url = str_replace("http://",'',$url);
  return "http://www.google.com/s2/favicons?domain=".$url;
}


You May Also Like

Never Miss Any Web Tutorials, Guides, Tips and Free eBooks

Join Our Community Of 50,000+ Web Lovers and get a weekly newsletter in your inbox

 

I hate spam too. Unsubscribe at any time.

Leave a Comment