<!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>Convert a variant into a new variant object of another type</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.variant-and.html">variant_and</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-cat.html">variant_cat</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-cast" class="refentry"> <div class="refnamediv"> <h1 class="refname">variant_cast</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">variant_cast</span> — <span class="dc-title">Convert a variant into a new variant object of another type</span></p> </div> <div class="refsect1 description" id="refsect1-function.variant-cast-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="class.variant.html" class="type variant">variant</a></span> <span class="methodname"><strong>variant_cast</strong></span> ( <span class="methodparam"><span class="type"><a href="class.variant.html" class="type variant">variant</a></span> <code class="parameter">$variant</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code></span> )</div> <p class="para rdfs-comment"> This function makes a copy of <em><code class="parameter">variant</code></em> and then performs a variant cast operation to force the copy to have the type given by <em><code class="parameter">type</code></em>. </p> <p class="para"> This function wraps VariantChangeType() in the COM library; consult MSDN for more information. </p> </div> <div class="refsect1 parameters" id="refsect1-function.variant-cast-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> <dt> <span class="term"><em><code class="parameter">type</code></em></span> <dd> <p class="para"> <em><code class="parameter">type</code></em> should be one of the <strong><code>VT_XXX</code></strong> constants. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.variant-cast-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a <strong><code>VT_DATE</code></strong> variant. </p> </div> <div class="refsect1 seealso" id="refsect1-function.variant-cast-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.variant-set-type.html" class="function" rel="rdfs-seeAlso">variant_set_type()</a> - Convert a variant into another type "in-place"</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-and.html">variant_and</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-cat.html">variant_cat</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>