php - Unable to apply array_unique on exploded string -
I have some database records that I want to take in an array and some of them are duplicates. Attempted to filter with array_unique but it does not appear to work on explosion ()
-d strings.
$ string = 'one two three one'; $ Explosion = array_unique (explosion (',', $ string)); Var_dump ($ blast);
Output the following:
array (size = 1) 0 = & gt; I also tried to use the str_getcsv ()
function as a bit of a solution, but no one was able to use the string, 'one two three one' (length = 17)
Not benefited;
array_nank (str_getcsv ($ string));
What is the result of the above example?
Your string spam is delimited, not commas:
$ String = 'one two three one'; $ Explosion = array_unique (explosion ('', $ string)); Var_dump ($ blast);
Comments
Post a Comment