Home > php教程 > php手册 > DOM XPATH获取img src值的query

DOM XPATH获取img src值的query

WBOY
Release: 2016-06-06 20:27:32
Original
2516 people have browsed it

php中用DOM XPATH获取img src值的代码,需要的朋友可以参考下

复制代码 代码如下:


$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");
$prurl = $nodes->item(0)->nodeValue;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template