function.domdocument-get-element-by-id.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 48 行
HTML
48 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Searches for an element with a certain id</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.domdocument-dump-mem.html">DomDocument->dump_mem</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.domdocument-get-elements-by-tagname.html">DomDocument->get_elements_by_tagname</a></div> <div class="up"><a href="ref.domxml.html">DOM XML Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.domdocument-get-element-by-id" class="refentry"> <div class="refnamediv"> <h1 class="refname">DomDocument->get_element_by_id</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">DomDocument->get_element_by_id</span> — <span class="dc-title"> Searches for an element with a certain id </span></p> </div> <div class="refsect1 unknown"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.domelement.html" class="type domelement">domelement</a></span> <span class="methodname"><b><b>DomDocument->get_element_by_id</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$id</tt></span> )</div> <p class="para rdfs-comment"> This function is similar to <a href="function.domdocument-get-elements-by-tagname.html" class="function">domdocument_get_elements_by_tagname()</a> but searches for an element with a given id. According to the DOM standard this requires a DTD which defines the attribute ID to be of type ID, though the current implementation simply does an xpath search for "//*[@ID = '%s']". This does not comply to the DOM standard which requires to return null if it is not known which attribute is of type id. This behaviour is likely to be fixed, so do not rely on the current behaviour. </p> <p class="para"> See also <a href="function.domdocument-get-elements-by-tagname.html" class="function">domdocument_get_elements_by_tagname()</a> </p> </div> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.domdocument-dump-mem.html">DomDocument->dump_mem</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.domdocument-get-elements-by-tagname.html">DomDocument->get_elements_by_tagname</a></div> <div class="up"><a href="ref.domxml.html">DOM XML Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?