2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-06-20 22:25:43 +00:00
|
|
|
<!-- $Revision: 1.17 $ -->
|
|
|
|
<refentry xml:id="function.call-user-func-array" xmlns="http://docbook.org/ns/docbook">
|
2007-02-17 20:02:43 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>call_user_func_array</refname>
|
|
|
|
<refpurpose>Call a user function given with an array of parameters</refpurpose>
|
|
|
|
</refnamediv>
|
2007-02-17 20:03:06 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-02-17 20:02:43 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>mixed</type><methodname>call_user_func_array</methodname>
|
|
|
|
<methodparam><type>callback</type><parameter>function</parameter></methodparam>
|
|
|
|
<methodparam><type>array</type><parameter>param_arr</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-02-17 20:03:06 +00:00
|
|
|
Call a user defined <parameter>function</parameter> with the parameters in
|
|
|
|
<parameter>param_arr</parameter>.
|
2007-02-17 20:02:43 +00:00
|
|
|
</para>
|
2007-02-17 20:03:06 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>function</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The function to be called.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>param_arr</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The parameters to be passed to the function, as an indexed array.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns the function result, or &false; on error.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-02-17 20:02:43 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>call_user_func_array</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
2003-06-16 14:37:37 +00:00
|
|
|
<?php
|
2007-02-17 20:02:43 +00:00
|
|
|
function debug($var, $val)
|
2004-01-15 12:43:50 +00:00
|
|
|
{
|
2002-04-15 00:12:54 +00:00
|
|
|
echo "***DEBUGGING\nVARIABLE: $var\nVALUE:";
|
2003-12-15 16:55:22 +00:00
|
|
|
if (is_array($val) || is_object($val) || is_resource($val)) {
|
2002-04-15 00:12:54 +00:00
|
|
|
print_r($val);
|
2003-12-15 16:55:22 +00:00
|
|
|
} else {
|
2002-04-15 00:12:54 +00:00
|
|
|
echo "\n$val\n";
|
2003-12-15 16:55:22 +00:00
|
|
|
}
|
2002-04-15 00:12:54 +00:00
|
|
|
echo "***\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$c = mysql_connect();
|
2002-06-16 07:11:04 +00:00
|
|
|
$host = $_SERVER["SERVER_NAME"];
|
2002-04-15 00:12:54 +00:00
|
|
|
|
2003-12-15 16:55:22 +00:00
|
|
|
call_user_func_array('debug', array("host", $host));
|
|
|
|
call_user_func_array('debug', array("c", $c));
|
|
|
|
call_user_func_array('debug', array("_POST", $_POST));
|
2003-06-16 14:37:37 +00:00
|
|
|
?>
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
2007-02-17 20:02:43 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2007-02-17 20:03:06 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
2007-02-17 20:02:43 +00:00
|
|
|
<para>
|
2007-02-17 20:03:06 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>call_user_func</function></member>
|
|
|
|
<member>&seealso.callback;</member>
|
|
|
|
</simplelist>
|
2007-02-17 20:02:43 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-02-17 20:03:06 +00:00
|
|
|
|
2007-02-17 20:02:43 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|