<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set the URI containing the XML to parse</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xmlreader.next.html">XMLReader::next</a></div> <div class="next" style="text-align: right; float: right;"><a href="xmlreader.read.html">XMLReader::read</a></div> <div class="up"><a href="class.xmlreader.html">XMLReader</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="xmlreader.open" class="refentry"> <div class="refnamediv"> <h1 class="refname">XMLReader::open</h1> <p class="verinfo">(PHP 5 >= 5.1.0)</p><p class="refpurpose"><span class="refname">XMLReader::open</span> — <span class="dc-title">Set the URI containing the XML to parse</span></p> </div> <div class="refsect1 description" id="refsect1-xmlreader.open-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>XMLReader::open</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$URI</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span> ]] )</div> <p class="para rdfs-comment"> Set the URI containing the XML document to be parsed. </p> </div> <div class="refsect1 parameters" id="refsect1-xmlreader.open-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">URI</code></em></span> <dd> <p class="para"> URI pointing to the document. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">encoding</code></em></span> <dd> <p class="para"> The document encoding or <strong><code>NULL</code></strong>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">options</code></em></span> <dd> <p class="para"> A bitmask of the <a href="libxml.constants.html" class="link">LIBXML_*</a> constants. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-xmlreader.open-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. If called statically, returns an <a href="class.xmlreader.html" class="classname">XMLReader</a> or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 errors" id="refsect1-xmlreader.open-errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para">This method <em class="emphasis">may</em> be called statically, but will issue an <strong><code>E_STRICT</code></strong> error.</p> </div> <div class="refsect1 changelog" id="refsect1-xmlreader.open-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.2.0</td> <td> <em><code class="parameter">encoding</code></em> and <em><code class="parameter">options</code></em> were added. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-xmlreader.open-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="xmlreader.xml.html" class="methodname" rel="rdfs-seeAlso">XMLReader::xml()</a> - Set the data containing the XML to parse</span></li> <li class="member"> <span class="methodname"><a href="xmlreader.close.html" class="methodname" rel="rdfs-seeAlso">XMLReader::close()</a> - Close the XMLReader input</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xmlreader.next.html">XMLReader::next</a></div> <div class="next" style="text-align: right; float: right;"><a href="xmlreader.read.html">XMLReader::read</a></div> <div class="up"><a href="class.xmlreader.html">XMLReader</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>