note 31855 added to function.implode

From: Date: Tue, 06 May 2003 18:11:49 +0000
Subject: note 31855 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-47595@lists.php.net to get a copy of this message
This will fail because $goodvals is commented out. /* $goodvals[] = "1"; $goodvals[] = "7"; $goodvals[] = "12"; */ $string = implode(",", $goodvals); One fix is to make sure that the array has values in it with an if-block: /* $goodvals[] = "1"; $goodvals[] = "7"; $goodvals[] = "12"; */ if ($goodvals) { $string = implode(",", $goodvals); } -- http://www.php.net/manual/en/function.implode.php http://master.php.net/manage/user-notes.php?action=edit+31855 http://master.php.net/manage/user-notes.php?action=delete+31855 http://master.php.net/manage/user-notes.php?action=reject+31855

« previous php.notes (#47595) next »