/ Published in: PHP

Here's a function for "multi" exploding a string.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //the function //Param 1 has to be an Array //Param 2 has to be a String function multiexplode ($delimiters,$string) { if($delimiters != NULL) { foreach($ary as $key => $val) { $ary[$key] = multiexplode($delimiters, $val); } } return $ary; } // Example of use $string = "1-2-3|4-5|6:7-8-9-0|1,2:3-4|5"; $res = multiexplode($delimiters,$string); echo '<pre>'; echo '</pre>';
Comments
