Home > Backend Development > PHP Tutorial > DOM XPATH query_PHP tutorial to obtain img src value

DOM XPATH query_PHP tutorial to obtain img src value

WBOY
Release: 2016-07-21 16:13:00
Original
944 people have browsed it

Copy code The code is as follows:

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313583.htmlTechArticleCopy the code as follows: $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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template