I am trying to see if JQuery CDN exists or not via PHP
essentially what Paul Irish did here but with PHP instead.
http://paulirish.com/2010/the-protocol-relative-url/
I am trying following but it's not working. Is this possible without http/https?
This is based on How can I check if a URL exists via PHP?
$jquery_cur = '1.9.1'; // JQuery Version
$jquery_cdn = '//code.jquery.com/jquery-'.$jquery_cur.'.min.js';
$jquery_local = '/assets/js/libs/jquery-'.$jquery_cur.'.min.js';
$jquery_ver = $jquery_cdn; //Load the Jquery CDN version by default
$cdn_headers = @get_headers($jquery_ver);
if(strpos($cdn_headers[0], '404 Not Found')) {
$jquery_ver = $jquery_cdn;
}
else {
$jquery_ver = $jquery_local;
}