The favicon in PHP is dynamic. Just launched in Gmail, but really useful features are available in Gmail Lab. The number of unread emails is displayed directly on the dynamic favicon in your browser tab. If your browser window is small but actually useful in Gmail Lab. The number of unread emails is displayed directly on the dynamic favicon in your browser tab. If your browser opens a tag for the location and location at any time, it may be a wonderful feature to let users know about any unread projects.
Here is a small and powerful PHP script that allows you to create your own dynamic favicon. We will use the GD library of PHP to manipulate the favicon image and add it to its text.
Below is a simple script to read an icon image and add some text characters.
File: favicon. php
// Read the favicon favicon.png Template
// File from the current directory
$ Im = imagecreatefrompng ("favicon.png ");
// $ Im = imagecreatefromjpg ("favicon.jpg"); // use this function to load the favicon of the JPEG type
// $ Im = imagecreatefrombmp ("favicon.bmp"); // use this function to load favicon of the BMP type
/* Read characters, which must be added to favicon
* Get request
*/
If (isset ($ _ GET ['char ']) &! Empty ($ _ GET ['char ']) {
$ String = $ _ GET ['char '];
} Else {
/* Add some default values if no character is specified */
$ String = 'V ';
}
/* Background color of favicon */
$ Bg = imagecolorallocate ($ im, 255,255,255 );
/* Foreground (font) color for the favicon */
$ Black = imagecolorallocate ($ im, 0, 0, 0 );
/* Write favicon characters
* Arguements: Image, font size, x coordinate,
* Y coordinate, characterstring, color
*/
Imagechar ($ im, 2, 5, 1, $ string, $ black );
Header ('content-type: image/png ');
Imagepng ($ im );
?>
The above code is almost self-evident. We add the favicon image to a character from the GET request. Note: Here we use the favicon image of a template,
I modified. You can select any favicon from the favicon. php file near you.
Middleware has just launched a small but really useful feature in the Gmail Lab. The number of unread emails is displayed directly on the dynamic favicon in your browser tab. If your browser window...