How to check several direct download links active in php? [closed]

-2

Hello friends, my doubt is that I am trying to create a testator of direct download links online. I just want you to tell me that this online help please ..

    
asked by Vico Luis 08.11.2017 в 21:56
source

1 answer

1

A light way is to use the get_headers method that helps us get the response headers of an HTTP request.

The code for a correct request is 200, so we look for that value in the headers.

function existe_recurso($url){
   $cabeceras=get_headers($url);
   return stripos($cabeceras[0],"200 OK")?true:false;
}
    
answered by 09.11.2017 в 00:53