Question: i have a php string 

```
$select_columms = 'pid, p.title, caption, filepath, filename, encaption, user1, user2, user3, user4, user5, user6, ult_puja, p.title, user2, user3';

```

so i had this idea i could get a unique string with this line of code

```
$select_columns = implode(',', array_unique(array_filter(explode(',',$select_columns))));

```

but it doesn't seem to work can you see what i am missing?

*edit:*
*thanks* for the help my final code is:

```
$select_columns = implode(',', array_filter(array_unique(explode(',', $select_columns))));

```

which outputs `$select_columns = 'pid, p.title, caption, filepath, filename, encaption, user1, user2, user3, user4, user5, user6, ult_puja'`

i use the array\_filter in case i have input like `', pid,'`

Answer: 
seems fine to me. 2 issues:

1) you've spelt "`columns`" wrong in the variable declaration

2) `array_filter()` is redundant here - it works exactly the same without it.

demo:

```
$ php -a
Interactive shell

php > $select_columns = 'pid, p.title, caption, filepath, filename, encaption, user1, user2, user3, user4, user5, user6, ult_puja, p.title, user2, user3';

php > echo  implode(',', array_unique(explode(',',$select_columns)));
pid, p.title, caption, filepath, filename, encaption, user1, user2, user3, user4, user5, user6, ult_puja

php > 

```
```
$str = implode(',',array_unique(explode(',', $str)));

```