note 68840 deleted from function.explode by bjori

From: Date: Mon, 25 Sep 2006 08:05:33 +0000
Subject: note 68840 deleted from function.explode by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-117564@lists.php.net to get a copy of this message
Note Submitter: worldwideweb dot C-Kling dot de ---- Here's a function for exploding multidimensional data: <?php function multexplode($spacer,$string) { if (empty($spacer)) { return($string); } else { $trenn=array_shift($spacer); $string=explode($trenn,$string); while (list($key,$val) = each($string)) { $string[$key]=multexplode($spacer,$val); } return($string); } } ?> Example: <?php multexplode(array("|","+"),"test+bla+hello|just+two); ?>

« previous php.notes (#117564) next »