note 101640 deleted from function.imagecreatefromgif by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Dec 2010 16:01:43 +0000 |
| Subject: | note 101640 deleted from function.imagecreatefromgif by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175374@lists.php.net to get a copy of this message | ||
Note Submitter: tammam dot nima at gmail dot com
----
Animated GIFs can be loaded with imagecreatefromgif(), but can NOT be "created" by PHP
with imagegif().
If you are looking to have PHP open an animated GIF file, you can use file_get_contents.
This displays a different animated GIF for different countries.
<?php
//adImage.php
$countryByIP = file_get_contents('http://stonito.com/script/geoip/?ip=' .
$_SERVER['REMOTE_ADDR']);
if($countryByIP == "GB"){
$im = file_get_contents('UK.gif');
}else if($countryByIP == "US"){
$im = file_get_contents('US.gif');
}else if($countryByIP == "CA"){
$im = file_get_contents('Canada.gif');
}else if($countryByIP == "AU"){
$im = file_get_contents('Australia.gif');
}else{
$im = file_get_contents('OtherCountries.gif');
}
header('Content-Type: image/gif');
echo $im;
?>
In your page;
<img src="pathTo/adImage.php"/>