Home >Backend Development >PHP Tutorial >php code to obtain site description information

php code to obtain site description information

WBOY
WBOYOriginal
2016-07-25 08:56:57994browse
This article introduces how to use PHP code to obtain site description information, that is, the information in meta. Friends in need can refer to it.

PHP method to obtain meta site information, the code is as follows:

<?php
/**
* @get_meta_tags函数的应用实例
* @获取站点描述信息
* @edit:bbs.it-home.org
*
*/
// Header...
header("Content-Type: text/html; charset=utf-8");

// Function Starts Here...
function getInfo($URL){
  $getInfo= get_meta_tags($URL);
  return $getInfo;
}

// URL...
$URL = "http://bbs.it-home.org";  

$_getInfo = getInfo($URL);
        
// Print.
echo "$URL <p>";
echo $_getInfo ["author"]."<p>";   
echo $_getInfo ["keywords"]."<p>";    
echo $_getInfo ["description"]."<p>"; 
echo $_getInfo ["robots"]."<p>";
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn