tidyNode::isPhp Checks if a node is PHP &reftitle.description; booltidyNode::isPhp Tells if the node is PHP. &reftitle.returnvalues; Returns &true; if the current node is PHP code, &false; otherwise. &reftitle.examples; Extract PHP code from a mixed HTML document title'; ?> <# /* JSTE code */ alert('Hello World'); #> <% /* ASP code */ response.write("Hello World!") %> Hello World Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'php'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> &example.outputs; title'; ?> # php node #2 ]]> &reftitle.notes; This function was named tidy_node::is_php in PHP 4/Tidy 1.