Re: quick php for perl coder question
| From: | Kirk dot Johnson at zootweb dot com | Date: | Thu, 11 Sep 2008 19:50:32 +0000 |
| Subject: | Re: quick php for perl coder question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279919@lists.php.net to get a copy of this message | ||
Thomas Bolioli <tpblists@terranovum.com> wrote on 09/11/2008 01:10:18 PM:
> I want to return an array from a function.
> I have this:
> return array($found, $username, $email, $nickname);
> as my code. I have a bug in the code and I am not sure where yet. Should
> the above statement with this:
>
> array($vars);
> $vars = function($type, $abc, $xyz);
> $found = $vars[0];
> $username = $vars[1];
> $email = $vars[2];
> $nickname = $vars[3];
>
> on the other end work? If so, then the bug is somewhere else.
You probably want:
$vars = array();
instead of:
array($vars);
which will throw an undefined variable error (if error reporting is turned
up), but otherwise, yes, that should work.
Kirk