<?php
function extrairHostPorReferencia($url){
// Extraí tudo que estiver depois das duas primeiras barras "//
// Elimina os dois primeiros caracteres, que são "//"
$depois = substr($depois, 2) . "\n";
// Extraí tudo que estiver antes da primeira barra "/"
$antes = strstr($depois, '/', true); return $antes;
}
$url = "https://docs.google.com/uc?id=0B7zY19LCJa8XeXZtWklZbFBEVG8&export=download";
$site = extrairHostPorReferencia($url);
echo $site. "\n";
PD9waHAKCmZ1bmN0aW9uIGV4dHJhaXJIb3N0UG9yUmVmZXJlbmNpYSgkdXJsKXsKCS8vIEV4dHJhw60gdHVkbyBxdWUgZXN0aXZlciBkZXBvaXMgZGFzIGR1YXMgcHJpbWVpcmFzIGJhcnJhcyAiLy8KCSRkZXBvaXMgPSBzdHJzdHIoJHVybCwgIi8vIik7CgkKCS8vIEVsaW1pbmEgb3MgZG9pcyBwcmltZWlyb3MgY2FyYWN0ZXJlcywgcXVlIHPDo28gIi8vIgoJJGRlcG9pcyA9IHN1YnN0cigkZGVwb2lzLCAyKSAuICJcbiI7CgkKCS8vIEV4dHJhw60gdHVkbyBxdWUgZXN0aXZlciBhbnRlcyBkYSBwcmltZWlyYSBiYXJyYSAiLyIKCSRhbnRlcyAgPSBzdHJzdHIoJGRlcG9pcywgJy8nLCB0cnVlKTsKCXJldHVybiAkYW50ZXM7Cn0KCiR1cmwgID0gImh0dHBzOi8vZG9jcy5nb29nbGUuY29tL3VjP2lkPTBCN3pZMTlMQ0phOFhlWFp0V2tsWmJGQkVWRzgmZXhwb3J0PWRvd25sb2FkIjsKJHNpdGUgPSBleHRyYWlySG9zdFBvclJlZmVyZW5jaWEoJHVybCk7CmVjaG8gJHNpdGUuICJcbiI7