Hello,
I suppose the $enterprise variable doesn't hold an empty array but is not
defined and because of this you get the error. Test with the following
example:
<?php
$array = array();
$comma_separated = implode(",", $array);
echo $comma_separated;
?>
It does not send any errors back. If you substitute $array = array(); with
$array = ""; you'll get a woarning: "Warning: implode(): Bad arguments. in
temp.php on line 4".
Just have in mind that when posting multiple select fields and no options are
selected - you simply have no corresponding value in the _POST array (or in
the $enterpise variable if you're using register_globals). There's no empty
array but nothing defined.
On Wednesday 22 September 2004 13:16, [EMAIL PROTECTED] wrote:
> hi there,
>
> i am using implode to get the contents of an array into a single variable:
>
> $enterprises = implode(",", $enterprise) //enterprise contains the array.
>
> however, if the array is empty (the user didnt select anything in the
> form), the implode function errors out.
>
> can anyone think of a way round this?
>
> many thanks,
>
> luke m.
--
Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)
---------------------------------------------------------------------
Orbitel - the New Generation Telecom! See www.orbitel.bg.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php