note 68843 deleted from function.implode by hholzgra

From: Date: Thu, 02 Aug 2012 13:17:23 +0000
Subject: note 68843 deleted from function.implode by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189733@lists.php.net to get a copy of this message
Note Submitter: worldwideweb dot C-Kling dot de ---- A Script for imploding a multideimensional Array. You give an array of separators in the first argument, and a (multidimensional) array in the second. The script will return the imploded array. <?php function multimplode($spacer,$array) { if (!is_array($array)) { return($array); } if (empty($spacer)) { return(multimplode(array(""),$array)); } else { $trenn=array_shift($spacer); while (list($key,$val) = each($array)) { if (is_array($val)) { $array[$key]=multimplode($spacer,$val); } } $array=implode($trenn,$array); return($array); } } ?>

« previous php.notes (#189733) next »