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){
  3. $url = str_replace("http://",'',$url);
  4. //TODO : regex that removes the last part of the url and detects errors
  5. return "".$url;
  7. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.