开发者

DOMDocument xpath query image extention doesnt equal to specific ext?

getting all images aprt from png extension?

$xpath = new DOMXP开发者_StackOverflow中文版ath( $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


NOT in xpath is a function, not an operator. Try:

//img[not(ends-with(@src, 'png'))]

Also note I have changed from double-quotes "" to single quotes '' as the xpath string itself is delimited by "".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜