I have 2 db queries each build a string of numeric IDs. Then I combine the strings into one and sometime i can get duplicate vaalues in that combined string
$str = $str1.','.$str2;
$str = trim($str, ","); // if I have either one empty
$str = str_replace(",,", ",", $str );
echo $str;
3,25,1153,3
How do I remove duplicates and keep only distinct values in the string?