2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 06:52:11 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-12-16 13:18:08 +00:00
|
|
|
<refentry xml:id="domdocument.loadhtmlfile" xmlns="http://docbook.org/ns/docbook">
|
2004-12-31 11:49:57 +00:00
|
|
|
<refnamediv>
|
2007-12-16 13:18:08 +00:00
|
|
|
<refname>DOMDocument::loadHTMLFile</refname>
|
2004-12-31 11:49:57 +00:00
|
|
|
<refpurpose>
|
|
|
|
Load HTML from a file
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-12-16 13:18:08 +00:00
|
|
|
<methodsynopsis>
|
2013-06-18 05:36:30 +00:00
|
|
|
<modifier>public</modifier> <type>bool</type><methodname>DOMDocument::loadHTMLFile</methodname>
|
2007-12-16 13:18:08 +00:00
|
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
2013-05-17 19:01:19 +00:00
|
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
|
2007-12-16 13:18:08 +00:00
|
|
|
</methodsynopsis>
|
2004-12-31 11:49:57 +00:00
|
|
|
<para>
|
|
|
|
The function parses the HTML document in the file named
|
|
|
|
<parameter>filename</parameter>. Unlike loading XML, HTML does not have
|
|
|
|
to be well-formed to load.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>filename</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The path to the HTML file.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2013-05-17 19:01:19 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>options</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Since PHP 5.1.0 and Libxml 2.6.0, you may also use the
|
|
|
|
<parameter>options</parameter> parameter to specify <link
|
|
|
|
linkend="libxml.constants">additional Libxml parameters</link>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2004-12-31 11:49:57 +00:00
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2009-01-09 13:38:31 +00:00
|
|
|
&return.success; If called statically, returns a
|
2010-11-10 21:34:44 +00:00
|
|
|
<classname>DOMDocument</classname>&return.falseforfailure;.
|
2004-12-31 11:49:57 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-10-25 09:41:36 +00:00
|
|
|
<refsect1 role="errors">
|
|
|
|
&reftitle.errors;
|
|
|
|
<para>
|
|
|
|
If an empty string is passed as the <parameter>filename</parameter>
|
|
|
|
or an empty file is named, a warning will be generated. This warning
|
2009-10-16 08:49:17 +00:00
|
|
|
is not generated by libxml and cannot be handled using <link
|
|
|
|
linkend="function.libxml-use-internal-errors">libxml's error handling
|
|
|
|
functions</link>.
|
2007-10-25 09:41:36 +00:00
|
|
|
</para>
|
2010-11-10 21:34:44 +00:00
|
|
|
&dom.allowstatic;
|
2012-01-13 23:05:39 +00:00
|
|
|
&dom.malformederror;
|
2007-10-25 09:41:36 +00:00
|
|
|
</refsect1>
|
2004-12-31 11:49:57 +00:00
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Creating a Document</title>
|
|
|
|
<programlisting role="php">
|
2004-05-09 15:07:48 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$doc = new DOMDocument();
|
|
|
|
$doc->loadHTMLFile("filename.html");
|
2006-04-17 12:59:17 +00:00
|
|
|
echo $doc->saveHTML();
|
2004-05-09 15:07:48 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2004-12-31 11:49:57 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2013-05-17 19:01:19 +00:00
|
|
|
|
|
|
|
<refsect1 role="changelog">
|
|
|
|
&reftitle.changelog;
|
|
|
|
<para>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>&Version;</entry>
|
|
|
|
<entry>&Description;</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>5.1.0</entry>
|
|
|
|
<entry>
|
|
|
|
Added <parameter>options</parameter> parameter.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2004-12-31 11:49:57 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
2009-06-08 21:01:23 +00:00
|
|
|
<member><methodname>DOMDocument::loadHTML</methodname></member>
|
|
|
|
<member><methodname>DOMDocument::saveHTML</methodname></member>
|
|
|
|
<member><methodname>DOMDocument::saveHTMLFile</methodname></member>
|
2004-12-31 11:49:57 +00:00
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2004-05-09 15:07:48 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2004-05-09 15:07:48 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|