<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns a tidyNode object starting from the <head> tag of the tidy parse tree</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="tidy.getstatus.html">tidy::getStatus</a></div> <div class="next" style="text-align: right; float: right;"><a href="tidy.html.html">tidy::html</a></div> <div class="up"><a href="class.tidy.html">tidy</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="tidy.head" class="refentry"> <div class="refnamediv"> <h1 class="refname">tidy::head</h1> <h1 class="refname">tidy_get_head</h1> <p class="verinfo">(PHP 5, PECL tidy 0.5.2-1.0.0)</p><p class="refpurpose"><span class="refname">tidy::head</span> -- <span class="refname">tidy_get_head</span> — <span class="dc-title">Returns a <a href="class.tidynode.html" class="classname">tidyNode</a> object starting from the <head> tag of the tidy parse tree</span></p> </div> <div class="refsect1 description" id="refsect1-tidy.head-description"> <h3 class="title">Description</h3> <p class="para">Object oriented style</p> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span> <span class="methodname"><strong>tidy::head</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment">Procedural style</p> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.tidynode.html" class="type tidyNode">tidyNode</a></span> <span class="methodname"><strong>tidy_get_head</strong></span> ( <span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$object</code></span> )</div> <p class="para rdfs-comment"> Returns a <a href="class.tidynode.html" class="classname">tidyNode</a> object starting from the <head> tag of the tidy parse tree. </p> </div> <div class="refsect1 parameters" id="refsect1-tidy.head-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">object</code></em></span> <dd> <p class="para"> The <a href="class.tidy.html" class="classname">Tidy</a> object. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-tidy.head-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the <a href="class.tidynode.html" class="classname">tidyNode</a> object. </p> </div> <div class="refsect1 examples" id="refsect1-tidy.head-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4053"> <p><strong>Example #1 <span class="function"><strong>tidy::head()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$html </span><span style="color: #007700">= </span><span style="color: #DD0000">'<br /><html><br /> <head><br /> <title>test</title><br /> </head><br /> <body><br /> <p>paragraph</p><br /> </body><br /></html>'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$tidy </span><span style="color: #007700">= </span><span style="color: #0000BB">tidy_parse_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$head </span><span style="color: #007700">= </span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-></span><span style="color: #0000BB">head</span><span style="color: #007700">();<br />echo </span><span style="color: #0000BB">$head</span><span style="color: #007700">-></span><span style="color: #0000BB">value</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> <head> <title>test</title> </head> </pre></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-tidy.head-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> This function is only available with Zend Engine 2 (PHP >= 5.0.0).</span></p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-tidy.head-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"> <span class="function"><a href="tidy.body.html" class="function" rel="rdfs-seeAlso">tidy::body()</a> - Returns a tidyNode object starting from the <body> tag of the tidy parse tree</span></li> <li class="member"> <span class="function"><a href="tidy.html.html" class="function" rel="rdfs-seeAlso">tidy::html()</a> - Returns a tidyNode object starting from the <html> tag of the tidy parse tree</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="tidy.getstatus.html">tidy::getStatus</a></div> <div class="next" style="text-align: right; float: right;"><a href="tidy.html.html">tidy::html</a></div> <div class="up"><a href="class.tidy.html">tidy</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>