extract meta tags from file or url as array

php has a built in function that can be used to extract the meta tags from a page url into an array.

usage

just pass it a url, if you call this file meta.php. usage: meta.php?url=http://my-url.com/

code

<?php
if(!isset($_GET['url'])) {
	echo "Missing URL";
	return;
}
$url = $_GET['url'];
$tags = get_meta_tags($url);
var_dump($tags);
?>

Demo

Other Items in php
Page Views

This page has been viewed 150 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹