Home > php教程 > php手册 > body text

php get_meta_tags 函数

WBOY
Release: 2016-06-13 11:17:18
Original
1447 people have browsed it

php get_meta_tags 函数  

get_meta_tags
( PHP 4中, PHP 5中)

get_meta_tags -提取所有中继标记内容属性从一个文件并返回一个数组

描述
阵列get_meta_tags (字符串$文件名[ ,布尔$ use_include_path =虚假] )
打开文件,并解析其一行行的

标记的文件。剖析站“ /头” 。

参数

文件名
的路径, HTML文件,作为一个字符串。这可以是本地文件或网址。


例如# 1什么get_meta_tags ( )解析





“ /头” “ ! -解析停止在这里- ” (注意行结尾- PHP的使用功能解析本地的投入,所以在Mac文件将无法正常工作在Unix ) 。

use_include_path
设置use_include_path为TRUE将导致PHP中试图打开该文件的标准包括:沿道路按include_path指令。这是用于本地文件,而不是网址。


返回值
返回一个数组的所有解析元标记。

价值的Name属性成为关键的价值内容的财产的价值,传回的阵列,这样就可以轻松地使用标准数组函数遍历或访问单一的价值观。特殊字符的价值财产的名称取代' _ ' ,其余的将被转换为小写。如果有两个中继标记具有相同的名称,只有最后一个是返回。

修改

版本说明
4.0.5支持的HTML属性unquoted增加。


实例

例如# 2什么get_meta_tags ( )返回

// Assuming the above tags are at www.example.com
$tags = get_meta_tags('http://www.example.com/');

// Notice how the keys are all lowercase now, and
// how . was replaced by _ in the key.
echo $tags['author'];       // name
echo $tags['keywords'];     // php documentation
echo $tags['description'];  // a php manual
echo $tags['geo_position']; // 49.33;-86.59
?>


Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!