Header only retrieval in php via curl

class URIInfo
{
public $info;
public $header;
private $url;


public function __construct($url)
{
$this->url = $url;
$this->setData();
}

public function setData()
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->url);
curl_setopt($curl, CURLOPT_FILETIME, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$this->header = curl_exec($curl);
$this->info = curl_getinfo($curl);
curl_close($curl);
}


public function getFiletime()
{
return $this->info['filetime'];
}


// Other functions can be added to retrieve other information.
}


$uri_info = new URIInfo('http://vsjodha.com/');
$filetime = $uri_info->getFiletime();
if ($filetime != -1) {
echo date('Y-m-d H:i:s', $filetime);
} else {
echo 'filetime not available';
}