php get_meta_tags not fetching property =“og:type”标签 [英] php get_meta_tags not fetching property="og:type" tags

查看:141
本文介绍了php get_meta_tags not fetching property =“og:type”标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,php的get_meta_tags会获取具有名称字段的元标记,但有时候会有元标记没有字段,但使用property =作为标识符,而此函数不会获取它。 p>

是否有更好的方法来获取元标记,包括那些在php中拥有property =标识符的元素?

解决方案

使用DOM的loadHTML解析XML或HTML,并在其上运行xpath。


so php's get_meta_tags would fetch the meta tags that has a name field to it but sometimes there are meta tags that has no fields but uses property="" as identifier instead and this function is not fetching it....

is there any better way to get meta tags including those with property="" identifiers in php?

解决方案

Parse the XML or HTML yourself with DOM's loadHTML and run an xpath on it.

这篇关于php get_meta_tags not fetching property =“og:type”标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆