<?php $array1 = ['keepThis', 'remove', false, 'keep', 'save', 'delete']; $array2 = ['hangOnto', 'remove', null, 'retain', 'keep', 'delete']; var_export([ array_filter( $array1, fn($value, $index) => $array2[$index] !== $value, ARRAY_FILTER_USE_BOTH ), array_filter( $array2, fn($value, $index) => $array1[$index] !== $value, ARRAY_FILTER_USE_BOTH ) ]);
You have javascript disabled. You will not be able to edit any code.