1
を期待通りに動作しない(特別OG:タイトル、OG:説明とOG:画像を)...PHPのget_meta_tags()私はメタタグ取得したい
私は次のコードを使用し、
$tags = get_meta_tags('https://www.shoutmeloud.com/review-of-hostgator-webhosting-wordpress.html/');
echo "<pre>";
print_r($tags);
それはタグを返さなかったのはなぜ
http://phpfiddle.org/main/code/qe22-3r5n
:
それはPHPFidlle次の配列、
Array
(
[viewport] => width=device-width, initial-scale=1
[description] => Check out HostGator review for year 2017. This review if written after using Hostgator for 5 years. Is Hostgator Good hosting? Find out answer here
[twitter:card] => summary_large_image
[twitter:description] => Check out HostGator review for year 2017. This review if written after using Hostgator for 5 years. Is Hostgator Good hosting? Find out answer here
[twitter:title] => A Blogger Review of HostGator Shared Hosting Plan
[twitter:site] => @shoutmeloud
[twitter:image] => https://www.shoutmeloud.com/wp-content/uploads/2014/08/Review-of-Hostgator-Shared-Hosting-Plan.jpg
[twitter:creator] => @denharsh
[generator] => Easy Digital Downloads v2.8.14
[msapplication-tileimage] => https://www.shoutmeloud.com/wp-content/uploads/2017/12/cropped-favicon-270x270.png
)
を返します。 og:title, og:description and og:image
のようにそれらのURLのソースコードにもあります。この問題を解決するにはどうすればよいですか?
はこの回答をお試しください:https://stackoverflow.com/a/12014561/8566549 –