RE: [PHP] return array

2002-06-06 Thread Martin Towell

that seems odd
I've got a function that returns an array something like you had in your
example. eg

function blah()
{
  return array("C"=>3,"D"=>9,"M"=>1);
}
$arr = blah();

then doing  echo $arr["C"]  output's  3



-Original Message-
From: Jule Slootbeek [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 1:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] return array



> 
> try:
> 
> list($doo, $dah) = my_function();
> 

thanks alot
that was it

list ($array['name'], $array['password']);

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] return array

2002-06-06 Thread Jule Slootbeek


> 
> try:
> 
> list($doo, $dah) = my_function();
> 

thanks alot
that was it

list ($array['name'], $array['password']);

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] return array

2002-06-06 Thread Jason Wong

On Friday 07 June 2002 10:56, Jule Slootbeek wrote:
> Hey guys and gals,
>
> if i have a function
> and i return an array from it
>
> function my_function() {
> blabla;
> return array ($array['name'], $array['password']);
> }
>
> how do i get this into an array on the page i call the function?
>
> $array = my_function() doesn't work?

try:

list($doo, $dah) = my_function();

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If A equals success, then the formula is _A = _X + _Y + _Z.  _X is work.  
_Y
is play.  _Z is keep your mouth shut.
-- Albert Einstein
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php