mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151447 c90b9560-bf6c-de11-be94-00142212c4b1
102 lines
2.1 KiB
XML
102 lines
2.1 KiB
XML
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<refentry id="function.tidy-parse-string">
|
|
<refnamediv>
|
|
<refname>tidy_parse_string</refname>
|
|
<refpurpose>
|
|
Parse a document stored in a string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>tidy_parse_string</methodname>
|
|
<methodparam><type>string</type><parameter>input</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>tidy_parse_string</function> parses a document stored in a
|
|
string.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>tidy_parse_string</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
ob_start();
|
|
?>
|
|
|
|
<html>
|
|
<head>
|
|
<title>test</title>
|
|
</head>
|
|
<body>
|
|
<p>error<br>another line</i>
|
|
</body>
|
|
</html>
|
|
|
|
<?php
|
|
|
|
$buffer = ob_get_clean();
|
|
$config = array('indent' => TRUE,
|
|
'output-xhtml' => TRUE,
|
|
'wrap', 200);
|
|
|
|
$tidy = tidy_repair_string($buffer, $config, 'UTF8');
|
|
|
|
echo $tidy;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
The above example will output:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>
|
|
test
|
|
</title>
|
|
</head>
|
|
<body>
|
|
<p>
|
|
error<br />
|
|
another line
|
|
</p>
|
|
</body>
|
|
</html>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>tidy_parse_file</function>,
|
|
<function>tidy_repair_file</function> and
|
|
<function>tidy_repair_string</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
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
|
|
-->
|