Online Forum To Support Coders With Technical Assistance - Read Write Execute

How to check that image exists on remote url

Ankit Agrawal
Ankit Agrawal
Published on March 18, 2020 · 1 min read
To check image exists on remote url we have to get image size. 


<?php
$image_remote_link = "Your image remote url";
if (@getimagesize($image_remote_link)){
echo "image exists ";
} else {
echo "image does not exist";
}
?>

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article Htaccess – flags list Next Article → HTML5 interview questions