<?php $firstArray = array(3,4,5,6); $secondArray = array(4, 5); $outputArray = array(); foreach($firstArray as $firstArrayItem) { $found = false; foreach($secondArray as $secondArrayItem) { if($firstArrayItem == $secondArrayItem) { $found = true; } } if($found == false){ $outputArray[] = $firstArrayItem; } } print_r($outputArray);
You have javascript disabled. You will not be able to edit any code.