mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30300 c90b9560-bf6c-de11-be94-00142212c4b1
830 lines
23 KiB
XML
830 lines
23 KiB
XML
<reference id="ref.var">
|
|
<title>Variable Functions</title>
|
|
<titleabbrev>Variables</titleabbrev>
|
|
|
|
<refentry id="function.call-user-func">
|
|
<refnamediv>
|
|
<refname>call_user_func</refname>
|
|
<refpurpose>
|
|
Call a user function given by the first parameter
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed
|
|
<function>call_user_func</function>
|
|
</funcdef>
|
|
<paramdef>string
|
|
<parameter>function_name</parameter>
|
|
</paramdef>
|
|
<paramdef>mixed
|
|
<parameter><optional>parameter</optional></parameter>
|
|
</paramdef>
|
|
<paramdef>mixed
|
|
<parameter><optional>...</optional></parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Call a user defined function given by the
|
|
<parameter>function_name</parameter> parameter. Take the
|
|
following:
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
function barber ($type) {
|
|
print "You wanted a $type haircut, no problem";
|
|
}
|
|
call_user_func ('barber', "mushroom");
|
|
call_user_func ('barber', "shave");
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.doubleval">
|
|
<refnamediv>
|
|
<refname>doubleval</refname>
|
|
<refpurpose>Get double value of a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>double <function>doubleval</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
Returns the double (floating point) value of
|
|
<parameter>var</parameter>.
|
|
</simpara>
|
|
<para>
|
|
<parameter>Var</parameter> may be any scalar type. You cannot use
|
|
<function>doubleval</function> on arrays or objects.
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
$var = '122.34343The';
|
|
$double_value_of_var = doubleval ($var);
|
|
print $double_value_of_var; // prints 122.34343
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
See also <function>intval</function>,
|
|
<function>strval</function>, <function>settype</function> and
|
|
<link linkend="language.types.type-juggling">Type
|
|
juggling</link>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.empty">
|
|
<refnamediv>
|
|
<refname>empty</refname>
|
|
<refpurpose>Determine whether a variable is set</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>empty</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns false if <parameter>var</parameter> is set and has a
|
|
non-empty or non-zero value; true otherwise.
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
$var = 0;
|
|
if (empty($var)) { #evaluates true
|
|
print '$var is either 0 or not at all set';
|
|
}
|
|
if (!isset($var)) { // evaluates false
|
|
print 'The $var is not set at all';
|
|
}
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
Note that this is meaningless when used on anything which isn't a
|
|
variable; i.e. <command>empty (addslashes ($name))</command> has
|
|
no meaning since it would be checking whether something which
|
|
isn't a variable is a variable with a false value.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>isset</function> and
|
|
<function>unset</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.gettype">
|
|
<refnamediv>
|
|
<refname>gettype</refname>
|
|
<refpurpose>Get the type of a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>gettype</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns the type of the PHP variable
|
|
<parameter>var</parameter>.
|
|
</para>
|
|
<para>
|
|
Possibles values for the returned string are:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>"boolean"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"integer"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"double"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"string"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"array"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"object"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"resource"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"user function"</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>"unknown type"</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
See also <function>settype</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.intval">
|
|
<refnamediv>
|
|
<refname>intval</refname>
|
|
<refpurpose>Get integer value of a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>intval</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
<paramdef>int
|
|
<parameter><optional>base</optional></parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
Returns the integer value of <parameter>var</parameter>,
|
|
using the specified base for the conversion (the default is
|
|
base 10).
|
|
</simpara>
|
|
<simpara>
|
|
<parameter>Var</parameter> may be any scalar type. You cannot use
|
|
<function>intval</function> on arrays or objects.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>doubleval</function>,
|
|
<function>strval</function>, <function>settype</function> and
|
|
<link linkend="language.types.type-juggling">Type
|
|
juggling</link>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-array">
|
|
<refnamediv>
|
|
<refname>is_array</refname>
|
|
<refpurpose>Finds whether a variable is an array</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_array</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is an array, false
|
|
otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>,
|
|
<function>is_long</function>, and
|
|
<function>is_object</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-bool">
|
|
<refnamediv>
|
|
<refname>is_bool</refname>
|
|
<refpurpose>
|
|
Finds out whether a variable is a boolean
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int
|
|
<function>is_bool</function>
|
|
</funcdef>
|
|
<paramdef>mixed
|
|
<parameter>var</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if the <parameter>var</parameter> parameter is
|
|
a boolean.
|
|
</para>
|
|
<para>
|
|
See also <function>is_array</function>,
|
|
<function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>,
|
|
<function>is_long</function>, and
|
|
<function>is_object</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-double">
|
|
<refnamediv>
|
|
<refname>is_double</refname>
|
|
<refpurpose>Finds whether a variable is a double</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_double</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is a double,
|
|
false otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_array</function>,
|
|
<function>is_bool</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>,
|
|
<function>is_long</function>, and
|
|
<function>is_object</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-float">
|
|
<refnamediv>
|
|
<refname>is_float</refname>
|
|
<refpurpose>Finds whether a variable is a float</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_float</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function is an alias for <function>is_double</function>.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>is_double</function>,
|
|
<function>is_bool</function>,
|
|
<function>is_real</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_string</function>,
|
|
<function>is_object</function>,
|
|
<function>is_array</function>, and
|
|
<function>is_long</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-int">
|
|
<refnamediv>
|
|
<refname>is_int</refname>
|
|
<refpurpose>Find whether a variable is an integer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_int</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function is an alias for <function>is_long</function>.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>is_bool</function>,
|
|
<function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_string</function>,
|
|
<function>is_real</function>,
|
|
<function>is_object</function>,
|
|
<function>is_array</function>, and
|
|
<function>is_long</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-integer">
|
|
<refnamediv>
|
|
<refname>is_integer</refname>
|
|
<refpurpose>Find whether a variable is an integer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_integer</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function is an alias for
|
|
<function>is_long</function>.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>is_bool</function>,
|
|
<function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_string</function>,
|
|
<function>is_real</function>,
|
|
<function>is_object</function>,
|
|
<function>is_array</function>, and
|
|
<function>is_long</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-long">
|
|
<refnamediv>
|
|
<refname>is_long</refname>
|
|
<refpurpose>Finds whether a variable is an integer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_long</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is an integer (long),
|
|
false otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_bool</function>,
|
|
<function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>,
|
|
<function>is_object</function>,
|
|
<function>is_array</function>, and
|
|
<function>is_integer</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-numeric">
|
|
<refnamediv>
|
|
<refname>is_numeric</refname>
|
|
<refpurpose>
|
|
Finds whether a variable is a number or a numeric string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_numeric</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is a number or a
|
|
numeric string, false otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_bool</function>,
|
|
<function>is_double</function>,
|
|
<function>is_float</function>,
|
|
<function>is_int</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>,
|
|
<function>is_object</function>,
|
|
<function>is_array</function>, and
|
|
<function>is_integer</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-object">
|
|
<refnamediv>
|
|
<refname>is_object</refname>
|
|
<refpurpose>Finds whether a variable is an object</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_object</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is an object, false
|
|
otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_bool</function>,
|
|
<function>is_long</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_float</function>,
|
|
<function>is_double</function>,
|
|
<function>is_real</function>,
|
|
<function>is_string</function>, and
|
|
<function>is_array</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-real">
|
|
<refnamediv>
|
|
<refname>is_real</refname>
|
|
<refpurpose>Finds whether a variable is a real</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_real</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function is an alias for <function>is_double</function>.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>is_bool</function>,
|
|
<function>is_long</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_float</function>,
|
|
<function>is_double</function>,
|
|
<function>is_object</function>,
|
|
<function>is_string</function>, and
|
|
<function>is_array</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-resource">
|
|
<refnamediv>
|
|
<refname>is_resource</refname>
|
|
<refpurpose>
|
|
Finds whether a variable is a resource
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int
|
|
<function>is_resource</function>
|
|
</funcdef>
|
|
<paramdef>mixed
|
|
<parameter>var</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
<function>is_resource</function> returns true if the variable
|
|
given by the <parameter>var</parameter> parameter is a resource,
|
|
otherwise it returns false.
|
|
</para>
|
|
<para>
|
|
Resources are things like file or database result handles that
|
|
are allocated and freed by internal PHP functions and that may
|
|
need some cleanup when they are no longer in use but haven't been
|
|
freed by user code.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.is-string">
|
|
<refnamediv>
|
|
<refname>is_string</refname>
|
|
<refpurpose>Finds whether a variable is a string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>is_string</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns true if <parameter>var</parameter> is a string,
|
|
false otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>is_bool</function>,
|
|
<function>is_long</function>,
|
|
<function>is_int</function>,
|
|
<function>is_integer</function>,
|
|
<function>is_float</function>,
|
|
<function>is_double</function>,
|
|
<function>is_real</function>,
|
|
<function>is_object</function>, and
|
|
<function>is_array</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.isset">
|
|
<refnamediv>
|
|
<refname>isset</refname>
|
|
<refpurpose>Determine whether a variable is set</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>isset</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
Returns true if <parameter>var</parameter> exists;
|
|
false otherwise.
|
|
</simpara>
|
|
<para>
|
|
If a variable has been unset with <function>unset</function>,
|
|
it will no longer be <function>isset</function>.
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
$a = "test";
|
|
echo isset ($a); // true
|
|
unset ($a);
|
|
echo isset ($a); // false
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
See also <function>empty</function> and
|
|
<function>unset</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.print-r">
|
|
<refnamediv>
|
|
<refname>print_r</refname>
|
|
<refpurpose>
|
|
Prints human-readable information about a variable
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>print_r</function></funcdef>
|
|
<paramdef>mixed <parameter>expression</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function displays information about the values of variables
|
|
in a way that's readable by humans. If given a string, integer
|
|
or double, the value itself will be printed. If given an array,
|
|
values will be presented in a format that shows keys and
|
|
elements. Similar notation is used for objects.
|
|
</simpara>
|
|
<simpara>
|
|
Compare <function>print_r</function> to
|
|
<function>var_dump</function>.
|
|
</simpara>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<?php
|
|
$a = array (1, 2, array ("a", "b", "c"));
|
|
print_r ($a);
|
|
?>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<warning>
|
|
<para>
|
|
This function will continue forever if given an array or object
|
|
that contains a direct or indirect reference to itself or that
|
|
contains an array or object on a deeper level that does so.
|
|
This is especially true for <literal>print_r($GLOBALS)</literal>,
|
|
as <literal>$GLOBALS</literal> is itself a global variable and
|
|
contains a reference to itself as such.
|
|
</para>
|
|
</warning>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.settype">
|
|
<refnamediv>
|
|
<refname>settype</refname>
|
|
<refpurpose>Set the type of a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>settype</function></funcdef>
|
|
<paramdef>string <parameter>var</parameter></paramdef>
|
|
<paramdef>string <parameter>type</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Set the type of variable <parameter>var</parameter> to
|
|
<parameter>type</parameter>.
|
|
</para>
|
|
<para>
|
|
Possibles values of <parameter>type</parameter> are:
|
|
<itemizedlist>
|
|
<listitem><simpara>"integer"</simpara></listitem>
|
|
<listitem><simpara>"double"</simpara></listitem>
|
|
<listitem><simpara>"string"</simpara></listitem>
|
|
<listitem><simpara>"array"</simpara></listitem>
|
|
<listitem><simpara>"object"</simpara></listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
Returns true if successful; otherwise returns false.
|
|
</para>
|
|
<para>
|
|
See also <function>gettype</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.strval">
|
|
<refnamediv>
|
|
<refname>strval</refname>
|
|
<refpurpose>Get string value of a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>strval</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
Returns the string value of <parameter>var</parameter>.
|
|
</simpara>
|
|
<simpara>
|
|
<parameter>var</parameter> may be any scalar type. You cannot use
|
|
<function>strval</function> on arrays or objects.
|
|
</simpara>
|
|
<simpara>
|
|
See also <function>doubleval</function>,
|
|
<function>intval</function>, <function>settype</function> and
|
|
<link linkend="language.types.type-juggling">Type
|
|
juggling</link>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.unset">
|
|
<refnamediv>
|
|
<refname>unset</refname>
|
|
<refpurpose>Unset a given variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>unset</function></funcdef>
|
|
<paramdef>mixed <parameter>var</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
<function>unset</function> destroys the specified variable and
|
|
returns true.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>Unset</function> example</title>
|
|
<programlisting role="php">
|
|
unset ($foo);
|
|
unset ($bar['quux']);
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>isset</function> and
|
|
<function>empty</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.var-dump">
|
|
<refnamediv>
|
|
<refname>var_dump</refname>
|
|
<refpurpose>Dumps information about a variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>var_dump</function></funcdef>
|
|
<paramdef>mixed <parameter>expression</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
This function returns structured information about an expression
|
|
that includes its type and value. Arrays are explored
|
|
recursively with values indented to show structure.
|
|
</simpara>
|
|
<simpara>
|
|
Compare <function>var_dump</function> to
|
|
<function>print_r</function>.
|
|
</simpara>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<pre>
|
|
<?php
|
|
$a = array (1, 2, array ("a", "b", "c"));
|
|
var_dump ($a);
|
|
?>
|
|
</pre>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|