Explanation :
Concatenate the three strings and explode them using comma operator in to an array, find the unique entries from that array using array_unique
and finally implode it.
echo implode(',',array_unique(explode(',',$str1.','.$str2.','.$str3)));
Demonstration - PHP Native Functions
A regex - solution
$str = preg_match_all('@[0-9]@',$str1.$str2.$str3,$mtch);
echo implode(',',array_unique($mtch[0]));