Jump to content

picture extension


web_master

Recommended Posts

Why wouldn't you know the extension?

 

You could just do something like:

 

$exts = array('jpg', 'png', 'jpeg', 'gif', 'bmp');

 

foreach($exts as $ext) if(file_exists("./up_main/".$request['main_id']."_mainphoto_th".$ext)) { $photo_dest = "./up_main/".$request['main_id']."_mainphoto_th".$ext; break; }

 

Thats about all you can do, since yout not trying to figure out the file type, you are trying to guess the file name.

Link to comment
https://forums.phpfreaks.com/topic/114607-picture-extension/#findComment-589301
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.