title: how to check if a url is an image url with php?
body: <p>I need to check the url is image url or not? How can i do this?</p>
  
  <p>Examples : </p>
  
  <ul>
  <li><a href="http://www.google.com/" rel="nofollow noreferrer"><code>http://www.google.com/</code></a> <b>is not</b> an image url.</li>
  <li><a href="http://www.hoax-slayer.com/images/worlds-strongest-dog.jpg" rel="nofollow noreferrer"><code>http://www.hoax-slayer.com/images/worlds-strongest-dog.jpg</code></a> <b>is</b> an image url.</li>
  <li><a href="http://www.hoax-slayer.com/images/worlds-strongest-dog.jpg" rel="nofollow noreferrer"><code>https://stackoverflow.com/search?q=.jpg</code></a> <b>is not</b> an image url.</li>
  <li><a href="http://www.google.com/profiles/c/photos/private/AIbEiAIAAABECK386sLjh92M4AEiC3ZjYXJkX3Bob3RvKigyOTEzMmFmMDI5ODQ3MzQxNWQxY2VlYjYwYmE2ZTA4YzFhNDhlMjBmMAEFQ7chSa4PMFM0qw02kilNVE1Hpw" rel="nofollow noreferrer"><code>http://www.google.com/profiles/c/photos/private/AIbEiAIAAABECK386sLjh92M4AEiC3ZjYXJkX3Bob3RvKigyOTEzMmFmMDI5ODQ3MzQxNWQxY2VlYjYwYmE2ZTA4YzFhNDhlMjBmMAEFQ7chSa4PMFM0qw02kilNVE1Hpw</code></a> <b>is</b> an image url.</li>
  </ul>