Find out what image it is...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Find out what image it is...

Post by Dale »

Say i had a varible $imagename and it's value was:

Code: Select all

http://www.d-frame.co.uk/images/logo.gif
, what pieces of code can i use to tell the visitor that that image is a GIF ? I know it sounds a weird question but can someone pwease help me :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

getimagesize()will cover most image types you're likely to encounter, other tools include ImageMagick's indentifier stuffs...
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

Cheers ;)
Post Reply