note 68840 added to function.explode
| From: | worldwidewebdotC-Klingdotde at osu1 dot php dot net | Date: | Sat, 12 Aug 2006 18:31:52 +0000 |
| Subject: | note 68840 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115837@lists.php.net to get a copy of this message | ||
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);
?>
----
Server IP: 217.160.72.57
Probable Submitter: 217.87.251.118
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- https://master.php.net/note/edit/68840
Del: integrated -- https://master.php.net/note/delete/68840/integrated
Del: useless -- https://master.php.net/note/delete/68840/useless
Del: bad code -- https://master.php.net/note/delete/68840/bad+code
Del: spam -- https://master.php.net/note/delete/68840/spam
Del: non-english -- https://master.php.net/note/delete/68840/non-english
Del: in docs -- https://master.php.net/note/delete/68840/in+docs
Del: other reasons-- https://master.php.net/note/delete/68840
Reject -- https://master.php.net/note/reject/68840
Search -- https://master.php.net/manage/user-notes.php