Check If The Link Is Image Or Url Php

[Solved] Check If The Link Is Image Or Url Php | Php - Code Explorer | yomemimo.com
Question : check if the link is image or url php

Answered by : splendid-stoat-wyg10kuj7db2

$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";
}

Source : https://stackoverflow.com/questions/40694640/php-check-if-link-is-image-and-check-if-exists | Last Update : Thu, 09 Dec 21

Answers related to check if the link is image or url php

Code Explorer Popular Question For Php