Try:

************************************************
if (!is_array($array_id))
{
 $string_id=$array_id;
}
else
{
 $string_id= implode(":",$array_id);
}
************************************************

You have to always make sure, you are passing Array into an implode() or
explode().

BTW: your code would look cooler like this: 

$string_id = is_array($array_id) ? implode(":",$array_id) : $array_id;



Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: Martin Cabrera Diaubalick [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 5:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] All of a sudden I get Warning: Bad arguments to implode()
in busca_01.php on line 133


Hello Everyone!

This is my code

************************************************
if (count($array_id)==1)
{
 $string_id=$array_id;
}
else
{
 $string_id= implode(":",$array_id);
}
************************************************

I've been testing it for three days and never had an error, now it comes and
goes. Do you know what could be wrong?

$array_id is an array of integers

Thanks in advance


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to