0

how do I grab title,description and keywords...without get_meta_tags function??

hakre
  • 193,403
  • 52
  • 435
  • 836
mathew
  • 65
  • 1
  • 3
  • 6

2 Answers2

1

You can also try this HTML DOM parser: http://simplehtmldom.sourceforge.net/

AJJ
  • 7,365
  • 7
  • 31
  • 34
0

An option:

<?php

$database = 'meta_tags.txt';
$meta_db = fopen($database, 'r');

$page = $_SERVER['SCRIPT_NAME'];
$page = substr($page, 1);

while($data = fgetcsv($meta_db, 9000, '|'))
{
    if($data[0] == $page)
    {
                $title = $data[1];
        $meta_keywords = $data[2];
        $meta_description = $data[3];
    }
}

?>

Taken from:

http://www.hawkee.com/snippet/3640/

benhowdle89
  • 36,900
  • 69
  • 202
  • 331
  • 1
    You've just gone to the third Google result for "php meta tags" and pasted the code, without bothering to notice that it's completely meaningless on its own. – Lightness Races in Orbit Jan 13 '11 at 10:33
  • Wow how did you know that!? amazing. Just trying to help. And i provided a link so he could see full code and its alternative to get_meta_tags... – benhowdle89 Jan 13 '11 at 10:36
  • see I havent done that...after testing various options with meta tags I have seen that for some sites get_meta_tags fucntion taking too long. I am doing a data mining with my 100k website list and when I put it into loops some time one loop is taking more time to complete. this is why and I have read many articles says get_meta_tags delays it so thought will ask for any alternative – mathew Jan 13 '11 at 10:38