Search Tech Blog

PHP dynamic Favicon Script

P

What is a dynamic Counter Favicon you will ask? No, you already know! We all have already seen the small icon in the Browser Tab called Favicon. But if you want to read more about this tiny little thing, take a look at the Favicon-Cheat-Sheet on GitHub Page from Audrey Roy Greenfeld. But today i want to direct your attention to an other topic. Dynamic content in such an favicon. This can be used for a counter of unread e-mails or a number of search hits you get from a search-engine. Oh, that is our subject…

I present you a little PHP script that generate a dynamic favicon for e.g. a message count or whatever, direct in your browser tab icon. If your browser has lots of tabs open, this might be a really useful feature that let user know of any important count item. This small but powerful script in PHP let you create your own dynamic Favicon. It will use the PHP GD library to manipulate the favicon image and add text (maximum two digits) into it. If you try to give a longer Text to the Script it will show three dots in the icon (…) – thats all 😉

422737 / Pixabay

Take a look at the “PHP dynamic Counter Favicon” on my GitHub, it also comes with three example PNG Frames and a Test-Script that show how it works.

Please give it a try and i will be happy if you comment in what environment you use it.

About the author

I. Gaffling

I would like to introduce myself, my name is Igor Gaffling, I was born in 1968 and have more than 30 years of experience in the IT- and new-media industry. In this blog I write about how search engines work, facts, ideas, code experiments and the possibility to develop a simple search engine from scratch that can handle a few million entries at an acceptable speed.

Add comment

Search Tech Blog

Latest posts

Latest comments

Categories

Tag Cloud