Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 770

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>gettype</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Variable Functions"
HREF="ref.variables.html"><LINK
REL="PREVIOUS"
TITLE="get_resource_type"
HREF="function.get-resource-type.html"><LINK
REL="NEXT"
TITLE="import_request_variables"
HREF="function.import-request-variables.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.get-resource-type.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.import-request-variables.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.gettype"
></A
>gettype</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN93804"
></A
><P
>    (PHP 3, PHP 4 )</P
>gettype&nbsp;--&nbsp;Get the type of a variable</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN93807"
></A
><H2
>Description</H2
>string <B
CLASS="methodname"
>gettype</B
> ( mixed var)<BR
></BR
><P
>&#13;     Returns the type of the PHP variable
     <TT
CLASS="parameter"
><I
>var</I
></TT
>.
    </P
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>Warning</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;      Never use <B
CLASS="function"
>gettype()</B
> to test for a certain type,
      since the returned string may be subject to change in a future version.
      In addition, it is slow too, as it involves string comparision .
     </P
><P
>&#13;      Instead, use the <TT
CLASS="literal"
>is_*</TT
> functions.
     </P
></TD
></TR
></TABLE
></DIV
><P
>&#13;     Possibles values for the returned string are:
     <P
></P
><UL
><LI
><P
>"<A
HREF="language.types.boolean.html"
><B
CLASS="type"
>boolean</B
></A
>" (since PHP 4)</P
></LI
><LI
><P
>"<A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
>"</P
></LI
><LI
><P
>"<A
HREF="language.types.float.html"
><B
CLASS="type"
>double</B
></A
>" (for historical reasons "double" is
       returned in case of a <A
HREF="language.types.float.html"
><B
CLASS="type"
>float</B
></A
>, and not simply
       "float")</P
></LI
><LI
><P
>"<A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
>"</P
></LI
><LI
><P
>"<A
HREF="language.types.array.html"
><B
CLASS="type"
>array</B
></A
>"</P
></LI
><LI
><P
>"<A
HREF="language.types.object.html"
><B
CLASS="type"
>object</B
></A
>"</P
></LI
><LI
><P
>"<A
HREF="language.types.resource.html"
><B
CLASS="type"
>resource</B
></A
>" (since PHP 4)</P
></LI
><LI
><P
>"NULL" (since PHP 4)</P
></LI
><LI
><P
>"user function" (PHP 3 only, deprecated)</P
></LI
><LI
><P
>"unknown type"</P
></LI
></UL
>
    </P
><P
>&#13;     For PHP 4, you should use <A
HREF="function.function-exists.html"
><B
CLASS="function"
>function_exists()</B
></A
> and
     <A
HREF="function.method-exists.html"
><B
CLASS="function"
>method_exists()</B
></A
> to replace the prior usage of
     <B
CLASS="function"
>gettype()</B
> on a function.
    </P
><P
>&#13;     See also
     <A
HREF="function.settype.html"
><B
CLASS="function"
>settype()</B
></A
>,
     <A
HREF="function.is-array.html"
><B
CLASS="function"
>is_array()</B
></A
>,
     <A
HREF="function.is-bool.html"
><B
CLASS="function"
>is_bool()</B
></A
>,
     <A
HREF="function.is-float.html"
><B
CLASS="function"
>is_float()</B
></A
>,
     <A
HREF="function.is-integer.html"
><B
CLASS="function"
>is_integer()</B
></A
>,
     <A
HREF="function.is-null.html"
><B
CLASS="function"
>is_null()</B
></A
>,
     <A
HREF="function.is-numeric.html"
><B
CLASS="function"
>is_numeric()</B
></A
>,
     <A
HREF="function.is-object.html"
><B
CLASS="function"
>is_object()</B
></A
>,
     <A
HREF="function.is-resource.html"
><B
CLASS="function"
>is_resource()</B
></A
>,
     <A
HREF="function.is-scalar.html"
><B
CLASS="function"
>is_scalar()</B
></A
>, and
     <A
HREF="function.is-string.html"
><B
CLASS="function"
>is_string()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.get-resource-type.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.import-request-variables.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>get_resource_type</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.variables.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>import_request_variables</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>