0

I was trying to generate keywords using dynamic data & hence thought this function could be useful for others hence i have answered the question myself.

Arijit Aich
  • 161
  • 1
  • 2
  • 12

1 Answers1

0

Here is the function named scan_dups:

function scan_dups($value){
    $end = implode(', ',array_unique(explode(', ', $value)));
echo $end;
    }

Now when using, just put all your values inside a variable and put that variable inside this function. Eg:

$a = "a,b,c,d,e,g,f,g,g,s,d,gt,te,h,a";
echo scan_dups($a);

And the output would be:

a,b,c,d,e,g,f,s,gt,te,h

Arijit Aich
  • 161
  • 1
  • 2
  • 12