src/SimpleDOM.php
public function getNodeByName($strXpath, $strName)
    {
        $varResult = $this->xpath($strXpath . "[@name='" . $strName . "']");

        if ($varResult !== false) {
            // Get first element
            return reset($varResult);
        } else {
            return false;
        }
    }
public function getNodeByName($strXpath, $strName)
    {
        $varResult = $this->xpath($strXpath . "[@name='" . $strName . "']");

        if ($varResult !== false) {
            // Get first element
            return reset($varResult);
        } else {
            return false;
        }
    }
Get a node by attribute name and location in xpath

@param string $strXpath
@param string $strName
@return static[] if node not found, otherwise the element