title: How to Identify a File is image or not in PHP
body: <p>I have tried with <code>getimagesize()</code> , <code>finfo</code> and getting Mime type function. But I have noticed we can not trust on these function as I observed it's fails in my case for some image files. Do we have any better way to identify a file is image or not. 
  Use case  : I have one file with php code inside it. I have saved this file with some image extension. Now I want to block this file from getting uploaded.</p>