我有一段HTML代码:
<form method="post" action="/">
<input type="hidden" name="example-name" value="example-value">
<button type="submit">Submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
如何在PHP中使用DOMXPath提取隐藏输入的值?我试过像这样的事情:
//$site - the html code
$doc = new DOMDocument();
$doc->loadHTML($site);
$xpath = new DOMXpath($doc);
$kod = $xpath->query("//input[@name='example-name']");
foreach($kod as $node)
$values[]=$node->nodeValue;
return $values;
Run Code Online (Sandbox Code Playgroud)
但它返回一个空数组.哪里出错了?
我有大量扩展名为.gif的文件.我想将所有GIF动画移动到另一个目录.我怎么能用linux shell做到这一点?
我不喜欢这样的事情:example.com/?id=2222.如何将其更改为example.com/2222?