<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.tidy.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'tidy.getopt.php',
    1 => 'tidy::getOpt',
    2 => 'Returns the value of the specified configuration option for the tidy document',
  ),
  'up' => 
  array (
    0 => 'class.tidy.php',
    1 => 'tidy',
  ),
  'prev' => 
  array (
    0 => 'tidy.gethtmlver.php',
    1 => 'tidy::getHtmlVer',
  ),
  'next' => 
  array (
    0 => 'tidy.getoptdoc.php',
    1 => 'tidy::getOptDoc',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/tidy/tidy/getopt.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="tidy.getopt" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">tidy::getOpt</h1>
  <h1 class="refname">tidy_getopt</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8, PECL tidy &gt;= 0.5.2)</p><p class="refpurpose"><span class="refname">tidy::getOpt</span> -- <span class="refname">tidy_getopt</span> &mdash; <span class="dc-title">Returns the value of the specified configuration option for the tidy document</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-tidy.getopt-description">
  <h3 class="title">Description</h3>
  <p class="para">Object-oriented style</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>tidy::getOpt</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$option</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="para rdfs-comment">Procedural style</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>tidy_getopt</strong></span>(<span class="methodparam"><span class="type"><a href="class.tidy.php" class="type tidy">tidy</a></span> <code class="parameter">$tidy</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$option</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="para rdfs-comment">
   Returns the value of the specified <code class="parameter">option</code> for the
   specified tidy <code class="parameter">tidy</code>.  
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-tidy.getopt-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">tidy</code></dt>
     <dd>
      <p class="para">
       The <span class="classname"><a href="class.tidy.php" class="classname">Tidy</a></span> object.
      </p>
     </dd>
    
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       You will find a list with each configuration option and their types
       at: <a href="http://api.html-tidy.org/#quick-reference" class="link external">&raquo;&nbsp;http://api.html-tidy.org/#quick-reference</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tidy.getopt-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the value of the specified <code class="parameter">option</code>.
   The return type depends on the type of the specified one. 
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-tidy.getopt-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>tidy_getopt()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$html </span><span style="color: #007700">=</span><span style="color: #DD0000">'&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"&gt;<br />&lt;html&gt;&lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt;<br />&lt;body&gt;<br /><br />&lt;p&gt;&lt;img src="img.png"&gt;&lt;/p&gt;<br /><br />&lt;/body&gt;&lt;/html&gt;'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$config </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'accessibility-check' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">3</span><span style="color: #007700">,<br />                </span><span style="color: #DD0000">'alt-text' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'some text'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$tidy </span><span style="color: #007700">= new </span><span style="color: #0000BB">tidy</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">parseString</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">, </span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'accessibility-check'</span><span style="color: #007700">)); </span><span style="color: #FF8000">//integer<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'lower-literals'</span><span style="color: #007700">)); </span><span style="color: #FF8000">//boolean<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOpt</span><span style="color: #007700">(</span><span style="color: #DD0000">'alt-text'</span><span style="color: #007700">)); </span><span style="color: #FF8000">//string<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">int(3)
bool(true)
string(9) &quot;some text&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>

</div><?php manual_footer($setup); ?>