PHP 8.5.0 Alpha 1 available for testing

Voting

: max(seven, seven)?
(Example: nine)

The Note You're Voting On

mcilva
6 years ago
How to check if a url points to a valid video

<?php
function isVideo($url){
$url = get_headers($url,1);
if(
is_array($url['Content-Type'])){ //In some responses Content-type is an array
$video = strpos($url['Content-Type'][1],'video');
}else{
$video = strpos($url['Content-Type'],'video');
}
if(
$video !== false)
return
true;

return
false;
}

?>

<< Back to user notes page

To Top