note 90011 deleted from function.explode by danbrown
| From: | danbrown@php.net | Date: | Wed, 01 Apr 2009 21:29:03 +0000 |
| Subject: | note 90011 deleted from function.explode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152724@lists.php.net to get a copy of this message | ||
Note Submitter: ellis at geeklab dot net
----
I need a function to take comma separated values and output them as an array with out repeats.
<?php
function keyExplode($delimiter, $string)
{
$ret = array();
$arr = explode($delimiter, $string);
foreach($arr as $val)
{
$ret[$val] = 1;
}
return $ret;
}