Via curl from url i getting some info and i need to check if it is an image.
$result = curl_exec($ch);
UPDATE: Content-type checking is not a good idea, because it can be faked.
Via curl from url i getting some info and i need to check if it is an image.
$result = curl_exec($ch);
UPDATE: Content-type checking is not a good idea, because it can be faked.
I would personally use gd tools within PHP to check if its an image or not. You cannot trust that the source gives the right MIME within the header. More than once I have trusted the headers and been disappionted by the fact that the content was an image but was transferred (due to the way the url/server works) over another format.