Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何通过名称获取select标记的php DOMDocument xpath_Php_Xpath_Domdocument - Fatal编程技术网

如何通过名称获取select标记的php DOMDocument xpath

如何通过名称获取select标记的php DOMDocument xpath,php,xpath,domdocument,Php,Xpath,Domdocument,我有以下html: <select type="text" name="City" value=""> <option>city1</option> <option>city2</option> <option>city3</option> 这是行不通的,我不明白为什么 比尔试试看 $nodeList = $xpath->query("//select[@name='City']/option"); $

我有以下html:

<select type="text" name="City" value="">
<option>city1</option>
<option>city2</option>
<option>city3</option>
这是行不通的,我不明白为什么

比尔试试看

$nodeList = $xpath->query("//select[@name='City']/option");
$nodeList = $xpath->query("//select[@name='City']/option");