Pretty simple in php...
To get geo data to display for the text, they have a geo ip database that makes the 'text' argument a variable with the location of the surfer...
PHP Code:
$text = getLocationFromGeoDatabase($_SERVER["REMOTE_ADDR"]);
ImageString(image, font, x, y, $text, color);
That's how it's done in its simplest form. There are other functions to use true type fonts which look much better. Pick up a copy of "Programming PHP" by O'Reilly. Great book if you're just starting out with PHP (or even if you're not starting out, it's still a good reference book).
Most people use the geo db's from
www.maxmind.com. They offer a complete API to their database that makes it incredibly easy to use. This will overlay an image with a true type font using the maxmind db:
PHP Code:
include("geoip.inc");
header("Content-Type: image/jpeg");
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
$location = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
$im = ImageCreateFromJPEG("image.jpg");
Imagettftext($im, 14, 0, 10, 10, $textColor, 'verdana.ttf', $location);
ImageJPEG($im);
ImageDestroy($im);