DOMDocument xpath 查询图像扩展名不等于特定扩展名?
从 png 扩展名获取所有图像?
$xpath = new DOMXPath( $htmlget);
$nodelist = $xpath->query("//img[!ends-with(@src, "png")]");
我知道这不起作用,我希望能够跳过 png 的图像
getting all images aprt from png extension?
$xpath = new DOMXPath( $htmlget);
$nodelist = $xpath->query("//img[!ends-with(@src, "png")]");
i know this doesnt work, i want to be able to skip images which are png's
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NOT 在 xpath 中是一个函数,而不是一个运算符。尝试:
另请注意,我已将双引号
""
更改为单引号''
,因为 xpath 字符串本身由""
分隔。NOT in xpath is a function, not an operator. Try:
Also note I have changed from double-quotes
""
to single quotes''
as the xpath string itself is delimited by""
.