Date: 08/30/01
- Next message: Nic Skitt: "[PHP] Headers already sent...."
- Previous message: Andrey Hristov: "Re: [PHP] Headers already sent...."
- In reply to: Gerard Samuel: "Re: [PHP] strings in a function return"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<Original message>
From: Gerard Samuel <trini0 <email protected>>
Date: Wed, Aug 29, 2001 at 09:58:12PM -0400
Message-ID: <3B8D9DB4.10803 <email protected>>
Subject: Re: [PHP] strings in a function return
> I found an error, but it didn't do me any good.
> I tried this, any tips...
> Thanks
>
> function assign() {
> global $adminurl, $string;
> top();
> if ($string) {
> $data = explode ("|", $string);
> foreach ($data as $foo) {
> echo $foo[0]; }
> }
> <form>
>
> $array = array("$new_cat","$assigned_to","$job","$assigned_by");
> $string = implode("|",$array);
> return $string;
> }
>
> The variables that form $array are from the form....
</Original message>
<Reply>
Why use array("$new_cat",...,"$assigned_by");
Loose the quotes: array ($new_cat,...,$assigned_by);
You don't need to use implode(). Just return the array. In the
calling function you can then get the results in two ways:
$results = assign(); /* $results is an array */
or
list ($new_cat,...,$assigned_by) = assign();
If you want a better answer on what is going wrong, you'll need to
send some more code. Eg the code that you've now replaced by <form>.
It might just be that the error is in that part.
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Nic Skitt: "[PHP] Headers already sent...."
- Previous message: Andrey Hristov: "Re: [PHP] Headers already sent...."
- In reply to: Gerard Samuel: "Re: [PHP] strings in a function return"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

