ʹ��PHP���ɶ�̬��GIFͼ��

PHPû�й涨ֻ�����HTML����Ҳ���Է�������ɶ�̬��GIFͼ���ļ�������GIF��ʽ��ͼ������Ϊ����Ҫ�� PHP���ṩͼ����GD libraryһ����롣

Example 2-2. GIF creation with PHP

<?php
    Header("Content-type: image/gif");
    $string=implode($argv," ");
    $im = imagecreatefromgif("images/button1.gif");
    $orange = ImageColorAllocate($im, 220, 210, 60);
    px = (imagesx($im)-7.5*strlen($string))/2;
    ImageString($im,3,$px,9,$string,$orange);
    ImageGif($im);
    ImageDestroy($im);
?>

����ļ�����ͨ����ҳ������<img src="button.php3?text"> ����������á�������γ���button.php3ȡ���ַ���"text"���Ұ���д������ͼ�ϣ��������� "images/button1.gif"����Ȼ��������õ���ͼ��������Ϳ��Ժܷ�����������ֲ�ͬ����ʽ��ͬ�İ�ť��������ȥһ������ȥ�ػ��ˡ�ʹ������������ǽ�����̬�����ɡ�