get_meta_tags

get_meta_tags

get_meta_tags

get_meta_tags
- It extracts all meta tag content attributes from a file

and returns an array.

Syntax:

array get_meta_tags ( string filename [, int use_include_path])

It opens filename and parses it line by line for <meta>

tags of the form <meta name=”author” content=”name”>.

Example:

$result = get_meta_tags (”test.html”);
print_r($result);

content in “test.html”

<html>
<head>
<meta name=”keyword” content=”PHP”>
<meta name=”description” content=”PHP5 Manual”>
</head>
<body>
PHP 5
</body>
</html>

The output in $result is

Array
(
[keyword] => PHP
[description] => PHP5 Manual
)

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.