title: Get right type of a photo in PHP
body: <p>I've been tyring to upload photos on a website via a registeration form.</p>
  
  <p>However, my program at first was expecting ".jpg" photos.</p>
  
  <p>Whenever I renamed my photo from ".png" to ".jpg" I ended with a black photo.</p>
  
  <p>How could I avoid having a black photo when extension is changed ?</p>