note 113794 deleted from function.get-meta-tags by tularis
| From: | tularis@php.net | Date: | Tue, 03 Dec 2013 13:00:39 +0000 |
| Subject: | note 113794 deleted from function.get-meta-tags by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197729@lists.php.net to get a copy of this message | ||
Note Submitter: Raman Aggarwal
----
hy this code makes you eligble to enter url of site and extract it meta tags, enjoy coding:-}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
// Assuming the above tags are at www.example.com
$meta=$_POST['meta'];
$tags = get_meta_tags($meta);
// Notice how the keys are all lowercase now, and
// how . was replaced by _ in the key.
// name
// php documentation
// a php manual
// 49.33;-86.59
?>
<form action="extract-meta.php" method="post">
<table width="50%" border="2" align="center"
cellspacing="5">
<tr>
<td width="17%">Author name</td>
<td width="83%"><?php echo $tags['author'] ?></td>
</tr>
<tr>
<td>Keywords</td>
<td><?php echo $tags['keywords'] ?></td>
</tr>
<tr>
<td>Description</td>
<td><?php echo $tags['description'] ?></td>
</tr>
<tr>
<td>Geo position</td>
<td><?php echo $tags['geo_position'] ?></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="Search"
/></td>
<td><input name="meta" type="text" size="50" />
<input name="meta2" type="text" value="<?php echo $meta
?>" size="50" /></td>
</tr>
</table>
</form>
</body>
</html>