php code to obtain site description information

WBOY
Release: 2016-07-25 08:56:57
Original
959 people have browsed it
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>";
?>
Copy after login


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template