Basically I have a PHP page where I want to display some data, I also want the page to be downloadable and people can display it locally. But! I want to add a feature where I can check for an internet connection, connecting to the page's origin to see if resources are available such as external style sheets etc. I was checking for a connection like this:
public function connection(){
const location='http://myResource.co.uk/';
$curl=curl_init(location);
$result=curl_execute();
curl_close();
return($result==='I exist')?true:false;
}
Now I'm a bit stuck because I want my resources index to display information. But I also want to use it to say 'I exist' when checking for the resource. Is this possible? Or should I just use an additional file like a normally sane person? XD