Get favicon with Google


/ Published in: PHP
Save to your folder(s)

This fonction use Google Favicon Service to get the favicon from an URL. Good to know it exists...


Copy this code and paste it in your HTML
  1. function get_favicon($url){
  2.  
  3. $url = str_replace("http://",'',$url);
  4. //TODO : regex that removes the last part of the url and detects errors
  5. return "http://www.google.com/s2/favicons?domain=".$url;
  6.  
  7. }

Report this snippet


Comments


You need to login to view comments.