Get meta tags not working in php

I am trying to get meta tags on a website. Here is my code

 $tags = get_meta_tags('https://www.wired.com/story/avengers-infinity-war-d23-footage'); 
   print_r($tags); exit;

      

this returns empty. Any ideas?

Wesbite uses some compression similar to gzip.

+3


source to share


1 answer


You need to unpack it, for which you can use a thread wrapper . For example:.

$tags = get_meta_tags('compress.zlib://https://www.wired.com/story/avengers-infinity-war-d23-footage');
print_r($tags);

      



Outputs:

Array
(
    [viewport] => width=device-width, initial-scale=1
    [content-type] => article
    ...
)

      

+5


source







All Articles