<!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 the integer portion of a variant</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.variant-eqv.html">variant_eqv</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-get-type.html">variant_get_type</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.variant-fix" class="refentry"> <div class="refnamediv"> <h1 class="refname">variant_fix</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">variant_fix</span> — <span class="dc-title">Returns the integer portion of a variant</span></p> </div> <div class="refsect1 description" id="refsect1-function.variant-fix-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>variant_fix</strong></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$variant</code></span> )</div> <p class="para rdfs-comment"> Gets the integer portion of a variant. </p> </div> <div class="refsect1 parameters" id="refsect1-function.variant-fix-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">variant</code></em></span> <dd> <p class="para"> The variant. </p> </dd> </dt> </dl> </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> As with all the variant arithmetic functions, the parameters for this function can be either a PHP native type (integer, string, floating point, boolean or <strong><code>NULL</code></strong>), or an instance of a COM, VARIANT or DOTNET class. PHP native types will be converted to variants using the same rules as found in the constructor for the <a href="class.variant.html" class="xref">VARIANT</a> class. COM and DOTNET objects will have the value of their default property taken and used as the variant value. </p> <p class="para"> The variant arithmetic functions are wrappers around the similarly named functions in the COM library; for more information on these functions, consult the MSDN library. The PHP functions are named slightly differently; for example <span class="function"><a href="function.variant-add.html" class="function">variant_add()</a></span> in PHP corresponds to <em>VarAdd() </em> in the MSDN documentation. </p> </p></blockquote> </div> <div class="refsect1 returnvalues" id="refsect1-function.variant-fix-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> If <em><code class="parameter">variant</code></em> is negative, then the first negative integer greater than or equal to the variant is returned, otherwise returns the integer portion of the value of <em><code class="parameter">variant</code></em>. </p> </div> <div class="refsect1 notes" id="refsect1-function.variant-fix-notes"> <h3 class="title">Notes</h3> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara"> This documentation is based on the MSDN documentation; it appears that this function is either the same as <span class="function"><a href="function.variant-int.html" class="function">variant_int()</a></span>, or that there is an error in the MSDN documentation. </p> </div> </div> <div class="refsect1 seealso" id="refsect1-function.variant-fix-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.variant-int.html" class="function" rel="rdfs-seeAlso">variant_int()</a> - Returns the integer portion of a variant</span></li> <li class="member"> <span class="function"><a href="function.variant-round.html" class="function" rel="rdfs-seeAlso">variant_round()</a> - Rounds a variant to the specified number of decimal places</span></li> <li class="member"> <span class="function"><a href="function.floor.html" class="function" rel="rdfs-seeAlso">floor()</a> - Round fractions down</span></li> <li class="member"> <span class="function"><a href="function.ceil.html" class="function" rel="rdfs-seeAlso">ceil()</a> - Round fractions up</span></li> <li class="member"> <span class="function"><a href="function.round.html" class="function" rel="rdfs-seeAlso">round()</a> - Rounds a float</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.variant-eqv.html">variant_eqv</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-get-type.html">variant_get_type</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>