2013-05-07 106 views
0

我正在尝试阅读安全网页的元标记的内容。但发现它很难,因为这些属性不是像名称,作者等一般的属性。如果它们有任何可能的话,请告诉。如何获取网页的元标记的内容

在此先感谢。

+0

采取这些代码使用PHP代码软件写这些元标签看看[这里](http://stackoverflow.com/questions/1036351/是-IT-可能使用的 - jQuery的阅读-元标记) – 2013-05-07 18:52:31

回答

1

你是否在php.net中浏览过这些文章?

<meta name="author" content="name"> 
<meta name="keywords" content="php documentation"> 
<meta name="DESCRIPTION" content="a php manual"> 
<meta name="geo.position" content="49.33;-86.59"> 
</head> <!-- parsing stops here --> 

阅读以下

<?php 
// 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 
?> 

http://php.net/manual/en/function.get-meta-tags.php