Home » Code » Source Code for Dynamic unread count Favicon in PHP

Source Code for Dynamic unread count Favicon in PHP

<?php
Read the favicon template from favicon.png /
/ //file from current directory
con.png"); //$im = imagecreatefromjpg("f
$im = imagecreatefrompng("fav iavicon.jpg"); //using this function to load favicon of jpeg type
load favicon of bmp type /* Read the character which needs to be added in favicon from
//$im = imagecreatefrombmp("favicon.bmp"); //using this function to * get request */ if(isset($_GET['char']) && !empty($_GET['char'])) { $string = $_GET['char']; } else {
the favicon */ $bg = imagecolorallocate($im, 255, 255, 255);
/* If no character is specified; add some default value */ $string = 'V'; } /* background color fo r /* foreground (font) color for the favicon */ $black = imagecolorallocate($im, 0, 0, 0); /* Write the character in favicon
string, $black); header('Content-type: imag
* arguements: image, fontsize, x-coordinate, * y-coordinate, characterstring, color */ imagechar($im, 2, 5, 1, $e/png'); imagepng($im); ?>

0 comments:

Post a Comment