如何使用PHP获取当前网页的元标记?

I created following meta tags in head

<meta name="image" content="image url" />
<meta name="title" content="Page title" />

Now I used following code to extract URL and then the tags

$url='http://' .$_SERVER[ 'HTTP_HOST'].$_SERVER[ 'REQUEST_URI'];
$tags = get_meta_tags($url); 
$image = $tags['image'];
$title = $tags['title'];

The page however keeps loading and outputs nothing.

It's look like you call get_meta_tags script itself? If yes, you get infinite recursion and output nothing. Page keep loadings, and in the end, of course, would be a mistake - exceeded the maximum execution time.

How do you expect to see something if you're just assigning a variable and nothing else?

Do var_dump($image) and then for example die() to see it's content... or whatever you need.