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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -