Re: [PHP] implode errors if array empty

2004-09-22 Thread John Holmes
From: "Marek Kilimajer" <[EMAIL PROTECTED]> [EMAIL PROTECTED] wrote: resolved with if(empty()) - apologies. isset() is more apropriate as $enterprise is not defined at all, empty() will issue a notice. No it won't. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] implode errors if array empty

2004-09-22 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote: resolved with if(empty()) - apologies. isset() is more apropriate as $enterprise is not defined at all, empty() will issue a notice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] implode errors if array empty

2004-09-22 Thread Petar Nedyalkov
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: It does not send any errors back. If you substitute $array = array(); with $array = ""; you'll get a woarning: "Warning: implode():

Re: [PHP] implode errors if array empty

2004-09-22 Thread luke
resolved with if(empty()) - apologies. [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 an

[PHP] implode errors if array empty

2004-09-22 Thread luke
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