note 90011 added to function.explode
| From: | ellis at geeklab dot net | Date: | Wed, 01 Apr 2009 21:28:10 +0000 |
| Subject: | note 90011 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152723@lists.php.net to get a copy of this message | ||
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;
}
----
Server IP: 209.41.74.194
Probable Submitter: 68.238.158.178
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- https://master.php.net/note/edit/90011
Del: integrated -- https://master.php.net/note/delete/90011/integrated
Del: useless -- https://master.php.net/note/delete/90011/useless
Del: bad code -- https://master.php.net/note/delete/90011/bad+code
Del: spam -- https://master.php.net/note/delete/90011/spam
Del: non-english -- https://master.php.net/note/delete/90011/non-english
Del: in docs -- https://master.php.net/note/delete/90011/in+docs
Del: other reasons-- https://master.php.net/note/delete/90011
Reject -- https://master.php.net/note/reject/90011
Search -- https://master.php.net/manage/user-notes.php