Maison > Article > développement back-end > php数组找数有关问题
php数组找数问题?
$str ="1,2,3,4,5,6,0",$str1 ="1,3,5"如何找出str1中没有的数啊如$str2 ="2,4,6,0"
------解决方案--------------------
$diffArr=array_diff(explode(',',$str),explode(',',$str1)); //求差集 echo implode("," , $diffArr); //输出 <div class="clear"> </div>