<?php
$site = trim("http://www.nedir.com/kal%C4%B1n-ba%C4%9F%C4%B1rsak");
$doc = new DOMDocument();
$doc->loadHTML(file_get_contents($site));
$metas = $doc->getElementsByTagName('meta');
for ($i = 0; $i < $metas->length; $i++) {
$meta = $metas->item($i);
if ($meta->getAttribute('name') == 'description')
$description = $meta->getAttribute('content');
if ($meta->getAttribute('name') == 'keywords')
$keywords = $meta->getAttribute('content');
}
print_r($keywords);
### in curl ###
// $curl = curl_init();
// curl_setopt($curl,CURLOPT_URL, $site);
// curl_setopt($curl,@CURLOPT_RETURNTRANSFER, true);
// curl_setopt($curl,@CURLOPT_FOLLOWLOCATION, true);
// $exec = curl_exec($curl);
// preg_match('@<meta.*?name="keywords".*?content="(.*?)" />@si',$exec,$keywords);
// preg_match('@<meta.*?name="description".*?content="(.*?)".*?/>@si',$exec,$description);
// $keywords = $keywords[1];
// $description = $description[1];
// print_r($keywords);
koda bir sorun yok dosya ayarlarını böyle yaparsanız uygun olur.