I am a little confused. Here is what I am doing now to find out if it is a gif or a jpg:
$size_logo_gif = @getimagesize('/'.$path_images.'/'.$name_file.'/'.$name_file.'_logo.gif');
$size_logo_jpg = @getimagesize('/'.$path_images.'/'.$name_file.'/'.$name_file.'_logo.jpg');
if ( !$size_logo_gif && !$size_logo_jpg ) {
// no pics at all
} else if ( $size_logo_gif ) {
// the pic is gif
} else if ( $size_logo_jpg ) {
// the pic is a jpg
}
Of course I could use file_exists() instead of getimagesize(). I am not quite sure what the advantages are of using one over the other and if anybody knows if one of them is faster than the other let me know so I can reduce the load of the script and make it faster.
Anyway, this seems to work for me, I was just wondering if there was a faster way to do it or if there was a function that checks what type image it is.