jj20051 Posted August 21, 2008 Share Posted August 21, 2008 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 More sharing options...
mmarif4u Posted August 21, 2008 Share Posted August 21, 2008 Read this article, hope it will help. http://www.phpdig.net/ref/rn58re1164.html Link to comment https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/#findComment-621707 Share on other sites More sharing options...
jj20051 Posted August 21, 2008 Author Share Posted August 21, 2008 Ok I Got That Fixed and It Works Any Ideas On How To Read and Display The Title Of The Page As Well? Link to comment https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/#findComment-621713 Share on other sites More sharing options...
jj20051 Posted August 21, 2008 Author Share Posted August 21, 2008 Still Needing Some Help... See Above. Link to comment https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/#findComment-621729 Share on other sites More sharing options...
CaptainChainsaw Posted August 21, 2008 Share Posted August 21, 2008 Hi there, I created something a while ago that should help you out. http://captainchainsaw.ulmb.com/urlchecker.html Cheers, CC Link to comment https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/#findComment-622043 Share on other sites More sharing options...
CaptainChainsaw Posted August 22, 2008 Share Posted August 22, 2008 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; } Link to comment https://forums.phpfreaks.com/topic/120651-get_meta_tags-problem/#findComment-623277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.