2013-05-07 39 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