Dynamic image loading?
Moderator: General Moderators
Dynamic image loading?
Hi, Im using a geolocation database which outputs the countries name and a two letter country code. I would like to load the according country flag the country flags correspond to the two letters. Like Canada is CA and its image is ca.png. I would like to dynamically load the image. The two letters are a variable. Can i do this in php?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Dynamic image loading?
Code: Select all
<img src="images/<?php echo $country; ?>.png"/>Code: Select all
echo "<img src=\"images/$country.png\"/>";(#10850)