get meta description , title and image from url like facebook link sharing
问题 my code is function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } else { return false; } } function getMetas($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ // preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); preg_match("/<meta name=\"description\" content=\"(.*?)\"/",$str,$title); // preg_match( '<meta name="description".*content="([^"]+)">siU', $str, $title); return $title[1]; }