How to extract meta tags in PHP

3 Answers

0 votes
$meta_tags = get_meta_tags('http://www.webshopy.com'); 
if (isset($meta_tags['description']))
    echo $meta_tags['description'] . "<br />";

/*
run:

WebShopy - Search! before you buy to find great offers, coupons, discount and deals

*/




answered Apr 19, 2014 by avibootz
edited Jun 22, 2016 by avibootz
0 votes
$meta_tags = get_meta_tags('http://www.webshopy.com'); 

echo $meta_tags['keywords'] . "<br />";
echo $meta_tags['description'] . "<br />";
if (isset($meta_tags['author']))
    echo $meta_tags['author'] . "<br />";


/*
run:

serach, buy, discount, cheap, product, shop, voucher, deal, offer, deal, affordable, 
coupon, sale, bonus, rebate, promo, save on, gift, demo, trial


WebShopy - Search! before you buy to find great offers, coupons, discount and deals

*/

 



answered Jun 22, 2016 by avibootz
0 votes
echo "<pre>";
print_r(get_meta_tags('http://www.webshopy.com')); 
echo "</pre>";


/*
run:

Array
(
    [keywords] => serach, buy, discount, cheap, product, shop, voucher, deal, offer, deal, 
                  affordable, coupon, sale, bonus, rebate, promo, save on, gift, demo, trial
    [description] => WebShopy - Search! before you buy to find great offers, coupons, 
                     discount and deals
)

*/

 



answered Jun 22, 2016 by avibootz
...