This
PHP Favicon Grabber v1.1
use a given url, save a copy (if wished) and return the image path.
$url = 'example.com';
$grap_favicon = array(
'URL' => $url, // URL of the Page we like to get the Favicon from
'SAVE'=> true, // Save Favicon copy local (true) or return only favicon url (false)
'DIR' => './', // Local Dir the copy of the Favicon should be saved
'TRY' => true, // Try to get the Favicon frome the page (true) or only use the APIs (false)
'DEV' => null, // Give all Debug-Messages ('debug') or only make the work (null)
);
echo '<img src="https://github.com/gaffling/PHP-Grab-Favicon/raw/master/'.grap_favicon($grap_favicon).'">';
Optional split the download dir into several sub-dirs (MD5 segment of filename e.g. /af/cd/example.com.png) if there are a lot of favicons.
https://github.com/audreyr/favicon-cheat-sheet