DOM XPATH获取img src值的query_PHP
程序员文章站
2022-06-12 14:57:27
...
复制代码 代码如下:
$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");
$prurl = $nodes->item(0)->nodeValue;
$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");
$prurl = $nodes->item(0)->nodeValue;
上一篇: PHP获取MAC地址的函数代码