note 12890 deleted from function.implode by jimw

From: Date: Thu, 20 Dec 2001 22:27:29 +0000
Subject: note 12890 deleted from function.implode by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23501@lists.php.net to get a copy of this message
The IMPLODE-function does indeed implode, but it does not check for the number of elements in the array to be imploded. So I suggest that (until internally checked in the function!), you use a code-syntax like this : <?php $count = count($my_array); if ($count > 0) { $out = implode("|",$xyz) } else { $out = ""; } That way the IMPLODE will not "fail" on 0 elements. ?>

« previous php.notes (#23501) next »