// Convert e-mail to image (png)
function convertEmailToImg ($aValue, $aRed, $aGreen, $aBlue, $aAlphaF=0, $aAlphaB=127, $aFontSize=4)
{
$img= imagecreatetruecolor (imagefontwidth ($aFontSize) * strlen ($aValue), imagefontheight ($aFontSize));
imagesavealpha ($img, true);
imagefill ($img, 0, 0, imagecolorallocatealpha ($img, 0, 0, 0, $aAlphaB));
imagestring ($img, $aFontSize, 0, 0, $aValue, imagecolorallocatealpha ($img, $aRed, $aGreen, $aBlue, $aAlphaF));
ob_start ();
imagepng ($img);
imagedestroy ($img);
return base64_encode (ob_get_clean ());
}
// Example
$imgString= convertEmailToImg ('[email protected]', 0, 0, 255, 0, 127, 4);