ok say i have a link submitted and it is a direct link (yes a hot link!) to an image how can i find this out as the url is not always ending in .jpg or .jpeg or someother image ext.

some links that i know are ok are like this...

www.site.com/img1.jpg
www.site.com/img1.png

but if a url is..
www.site.com/img1.jpg?v=0

then my script can not work this out. and create a thumb nail from the image for my home page, i have to manually check each one and set it if it is an image. if not an image then it does not show any thumbnail.

is there another way to test?

thanks in advance for your help.

mlse

08-13-2008, 11:02 AM

Have a look at the parse_url (http://uk3.php.net/manual/en/function.parse-url.php) function - that should help you :)

Also check out mime_content_type (http://uk3.php.net/manual/en/function.mime-content-type.php) (although this has been deprecated - see the notes for the fuction) and the Fileinfo (http://uk3.php.net/manual/en/ref.fileinfo.php) extension that supercedes it.