With the Favicon class you can get a favicon image by a given URL. Favicon receives the image from the Google service and stores it in a local database in form of a Base64 code.
If you want to get lots of favicon images it could take a long time to request the service for each URL.
Instead with this class the favicon stays cached in your database.
With the $priority
property you can specify how often a cached favicon image should get refreshed by the Google service.
By default it is set to 30 days.
Favicon uses a MySQL database. In the src
folder you'll find the exported .sql
files.
Import them so you can use it.
<?php $myBlogFavicon = new Favicon("http://blog.lgk.io"); ?> <img src="<?php echo $myBlogFavicon->image; ?>" alt="Favicon">