On Tuesday 28 November 2006 20:09, Jochem Maas wrote:
> Kelly Jones wrote:
> > If I define a function like this:
> >
> > function foo ($x, $y, $z) {}
> >
> > and then call: foo(1,2,"bar");
> >
> > is there a function I can call inside foo() that yields this hash:
> >
> > {"x" => 1, "y" => 2, "z" =>
On Mon, November 27, 2006 7:57 pm, Kelly Jones wrote:
> If I define a function like this:
>
> function foo ($x, $y, $z) {}
>
> and then call: foo(1,2,"bar");
>
> is there a function I can call inside foo() that yields this hash:
>
> {"x" => 1, "y" => 2, "z" => "bar"}
>
> In other words, gives me th
Kelly Jones wrote:
> If I define a function like this:
>
> function foo ($x, $y, $z) {}
>
> and then call: foo(1,2,"bar");
>
> is there a function I can call inside foo() that yields this hash:
>
> {"x" => 1, "y" => 2, "z" => "bar"}
>
> In other words, gives me the values *and names* of the ar
# [EMAIL PROTECTED] / 2006-11-27 18:57:54 -0700:
> is there a function I can call inside foo() that yields this hash:
>
> {"x" => 1, "y" => 2, "z" => "bar"}
>
> In other words, gives me the values *and names* of the arguments to foo?
>
> func_get_args just yields the values.
>
> Having this fun
Well, I would reply that this is probably as easy to read ...
You should think about poeple having digg into your code, or about you in a few
month...
Moreover, having much parameters (more than 4) is not a good idea (for the same
reading and understanding reasons). Functions having more than 4
well upon reading user comments in manual, looks like the only solution is
to dump variables into an array, and pass the array to a function with a
single defined by-ref parameter, so it kind of defeats the purpose.
Oh well.
-Original Message-
From: Sean Malloy [mailto:[EMAIL PROTECTED]]
Hi again,
Now I did a different approach using an array as parameter and giving an
array back.
Strangely though it doesnt really work.
Following "hack" solution works as expected:
$num = pg_numrows($result);
for ($i = 0; $i < $num; $i++)
{
$ret_arr[$i] = pg_fetch_array($result);
$ret_arr
7 matches
Mail list logo