<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.domdocument.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'domdocument.load.php',
    1 => 'DOMDocument::load',
    2 => 'Load XML from a file',
  ),
  'up' => 
  array (
    0 => 'class.domdocument.php',
    1 => 'DOMDocument',
  ),
  'prev' => 
  array (
    0 => 'domdocument.importnode.php',
    1 => 'DOMDocument::importNode',
  ),
  'next' => 
  array (
    0 => 'domdocument.loadhtml.php',
    1 => 'DOMDocument::loadHTML',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/domdocument/load.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="domdocument.load" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMDocument::load</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DOMDocument::load</span> &mdash; <span class="dc-title">
   Load XML from a file
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-domdocument.load-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DOMDocument::load</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Loads an XML document from a file. 
  </p>
  <div class="warning"><strong class="warning">Avviso</strong>
   <p class="simpara">
    Unix style paths with forward slashes can cause significant performance
    degradation on Windows systems; be sure to call <span class="function"><a href="function.realpath.php" class="function">realpath()</a></span>
    in such a case.
   </p>
  </div>
 </div>

 <div class="refsect1 parameters" id="refsect1-domdocument.load-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       The path to the XML document.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       <a href="language.operators.bitwise.php" class="link">Bitwise <code class="literal">OR</code></a>
       of the <a href="libxml.constants.php" class="link">libxml option constants</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-domdocument.load-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-domdocument.load-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  <p class="para">
   If an empty string is passed as the <code class="parameter">filename</code>
   or an empty file is named, a warning will be generated. This warning
   is not generated by libxml and cannot be handled using libxml&#039;s error
   handling functions.
  </p>
 </div>

 <div class="refsect1 changelog" id="refsect1-domdocument.load-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       This function now has a tentative <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> return type.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Calling this function statically will
       now throw an <span class="classname"><a href="class.error.php" class="classname">Error</a></span>.
       Previously, an <strong><code><a href="errorfunc.constants.php#constant.e-deprecated">E_DEPRECATED</a></code></strong> was raised.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-domdocument.load-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Creating a Document</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$doc </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$doc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'examples/book.xml'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$doc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">saveXML</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-domdocument.load-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="domdocument.loadxml.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::loadXML()</a> - Load XML from a string</span></li>
    <li><span class="methodname"><a href="domdocument.save.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::save()</a> - Dumps the internal XML tree back into a file</span></li>
    <li><span class="methodname"><a href="domdocument.savexml.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::saveXML()</a> - Dumps the internal XML tree back into a string</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>