check if the link is image or url php

115

$headers = get_headers('https://media.giphy.com/media/BvvBz8BnRqZOg/giphy.gif', 1);
if (strpos($headers['Content-Type'], 'image/') !== false) {
    echo "Work";
} else {
    echo "Not Image";
}

Comments

Submit
0 Comments