mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 02:48:56 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
107 lines
2.1 KiB
XML
107 lines
2.1 KiB
XML
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<refentry xml:id="function.tidyNode-isPhp" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>tidyNode->isPhp</refname>
|
|
<refpurpose>
|
|
Returns true if this node is PHP
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>tidyNode->isPhp</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if the current node is PHP code, &false; otherwise.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>get the PHP code from a mixed HTML/PHP document</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$html = <<< HTML
|
|
<html><head>
|
|
<?php echo '<title>title</title>'; ?>
|
|
</head>
|
|
<body>
|
|
|
|
<?php
|
|
echo 'hello world!';
|
|
?>
|
|
|
|
</body></html>
|
|
HTML;
|
|
|
|
|
|
$tidy = tidy_parse_string($html);
|
|
$num = 0;
|
|
|
|
get_php($tidy->html());
|
|
|
|
|
|
function get_php($node) {
|
|
|
|
// check if the current node is PHP code
|
|
if($node->isPhp()) {
|
|
echo "\n\n# PHP node #" . ++$GLOBALS['num'] . "\n";
|
|
echo $node->value;
|
|
}
|
|
|
|
// check if the current node has childrens
|
|
if($node->hasChildren()) {
|
|
foreach($node->child as $child) {
|
|
get_php($child);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
# PHP node #1
|
|
<?php echo '<title>title</title>'; ?>
|
|
|
|
# PHP node #2
|
|
<?php
|
|
echo 'hello world!';
|
|
?>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function was named <function>tidy_node->is_php</function> in
|
|
PHP 4/Tidy 1.
|
|
</para>
|
|
</note>
|
|
</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
|
|
-->
|