Home  >  Article  >  Backend Development  >  DOM XPATH获取img src值的query_php技巧

DOM XPATH获取img src值的query_php技巧

WBOY
WBOYOriginal
2016-05-17 08:55:07878browse
复制代码 代码如下:

$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");
$prurl = $nodes->item(0)->nodeValue;
Statement:
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