我对如何访问 SourceUrl 以获取宽度 = 400 的图像有疑问
图像/di/47/6b/77/454430384d6d324b413332544a695675313851-400x400-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks19588&fks3
默认情况下,它向我显示宽度 = 100 的图像,并且不知何故我的 xpath 语法没有拾取 400
<?php
$string = <<<XML
<imageList>
<image available="true" height="100" width="100">
<sourceURL>images/di/47/6b/77/454430384d6d324b413332544a695675313851-100x100-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks=43998&fks=35198</sourceURL>
</image>
<image available="true" height="200" width="200"><sourceURL>images/di/47/6b/77/454430384d6d324b413332544a695675313851-200x200-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks=43998&fks=35198</sourceURL></image>
<image available="true" height="300" width="300"><sourceURL>images/di/47/6b/77/454430384d6d324b413332544a695675313851-300x300-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks=43998&fks=35198</sourceURL></image>
<image available="true" height="400" width="400"><sourceURL>images/di/47/6b/77/454430384d6d324b413332544a695675313851-400x400-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks=43998&fks=35198</sourceURL></image>
<image available="true" height="569" width="500"><sourceURL>images/di/47/6b/77/454430384d6d324b413332544a695675313851-500x569-0-0.jpg?p=p2.7f19fe93a466ae45afab&a=1&c=1&l=7000610&r=1&pr=1&lks=43998&fks=35198</sourceURL></image></imageList>
XML;
$xml = simplexml_load_string($string);
$result = $xml->xpath("//image[@height='400']/sourceURL");
?>