I need to check the url is image url or not? How can i do this?
Examples :
http://www.google.com/is not an image url.http://www.hoax-slayer.com/images/worlds-strongest-dog.jpgis an image url.https://stackoverflow.com/search?q=.jpgis not an image url.http://www.google.com/profiles/c/photos/private/AIbEiAIAAABECK386sLjh92M4AEiC3ZjYXJkX3Bob3RvKigyOTEzMmFmMDI5ODQ3MzQxNWQxY2VlYjYwYmE2ZTA4YzFhNDhlMjBmMAEFQ7chSa4PMFM0qw02kilNVE1Hpwis an image url.
If you want to be absolutely sure, and your PHP is enabled for remote connections, you can just use
If it returns an array, it is an image type recognized by PHP, even if the image extension is not in the url (per your second link). You have to keep in mind that this method will make a remote connection for each request, so perhaps cache urls that you already probed in a database to lower connections.