php
PHP - get_meta_tags 함수
array get_meta_tags ( string $filename [, bool $use_include_path ] )
(PHP 4, PHP 5)
파일에서 <head> 와 </head> 사이의 모든 메타 태그 내용 요소를 추출하여 배열로 반환합니다.
(PHP 4, PHP 5)
파일에서 <head> 와 </head> 사이의 모든 메타 태그 내용 요소를 추출하여 배열로 반환합니다.
<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>
<?php
$tags = get_meta_tags('http://www.example.com/');
// 키가 전부 소문자이고, .이 _로 치환되었다는 점에 주의하십시오.
echo $tags['author']; // 결과: name
echo $tags['keywords']; // 결과: php documentation
echo $tags['description']; // 결과: a php manual
echo $tags['geo_position']; // 결과: 49.33;-86.59
?>
0 댓글