Jump to content

get_meta_tags problem!


jj20051

Recommended Posts

I Made This Script To Read The Meta Tags Of A Specific Page, but For Some Reason It Doesn't Work. I Tried Another Companies Meta Tag Extractor On The Same URL and It Worked. Right Now My Code Creates A Blank Page...

 

<?php
$tags = get_meta_tags('http://www.money.com/');

echo $tags['author'];
echo $tags['keywords'];
echo $tags['description'];
echo $tags['geo_position'];

?> 

Link to comment
https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/
Share on other sites

If you can't be bothered looking at that link, here's the code you need:

 


public function getTitle($html){
    preg_match('/<title>\n*(.*?\n*.*?)\n*<\/title>/i',  "$html", $matches);
    $title = $matches[1];
    $this->_title = $title;
    return $this->_title;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.