Home » » Extract all meta tags from a webpage in php

Extract all meta tags from a webpage in php

Written By Unknown on Jumat, 25 Mei 2012 | 03.55

Php has a built in function get_meta_tags() which extracts all meta tags of a webpage and retuns an array of it. It takes a minimum of one  parameter (the path of the webpage). which can be local or an external webpage from other site.

It parses the webpage line by line for meta and stops when it gets </head> tag.
One thing to note here that It only extracts those meta which has name attribute set.


$metas = get_meta_tags('http://www.id-script.com');
echo "<pre>";
print_r($metas);
echo "</pre>";

Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger