Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
$myUrl = "[URL unfurl="true"]http://www.myServer.com/myPath/myFile.html";[/URL]
# parse the URL so you get the parts you need
$fsPara = parse_url($myUrl);
# open a socket connection to the server
$fID = fsockopen($fsPara["host"], 80);
if (!fID){
echo("Could not connect");
} else {
# use a HEAD header to see if it returns status code 200
fputs($fID, "HEAD $fsPara["path"] HTTP/1.0\r\nHost: $fsPara["host'}\r\n\r\n");
# read the response
$head = fread($fID, 4096);
fclose($fID);
# check for status 200 in the header
if (!preg_match('#^HTTP/.*\s+200\sOK\s#i', $head)){
# ... no file;
} else {
# file was accessible through HTTP
}
}