Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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
PHP-删除包含特定文本的父项_Php_Xpath_Extract - Fatal编程技术网

PHP-删除包含特定文本的父项

PHP-删除包含特定文本的父项,php,xpath,extract,Php,Xpath,Extract,HTML: <div class="vm-customfield-cart"> <span class="product-field-type-S">Some important text</span><br /> <span class="product-field-type-S">Lorem ipsum dolor</span><br /> </div> <div cl

HTML:

<div class="vm-customfield-cart">
     <span class="product-field-type-S">Some important text</span><br />
     <span class="product-field-type-S">Lorem ipsum dolor</span><br />
</div>
<div class="vm-customfield-cart">
     <span class="product-field-type-S">Some important text</span><br />
</div>
最终结果应该如下所示:

<div class="vm-customfield-cart">
     <span class="product-field-type-S">Some important text</span><br />
     <span class="product-field-type-S">Lorem ipsum dolor</span><br />
</div>
<div class="vm-customfield-cart">
     <span class="product-field-type-S">Some important text</span><br />
</div>

一些重要的文本
试试看

可能有帮助
//span[以(,'Lorem ipsum')开头]