Scooby08 Posted February 26, 2010 Share Posted February 26, 2010 If I have 2 arrays, one that is my base array, and another that is the item to be removed array, and they are like so: Base array Array ( [0] => 608569 [1] => 608570 [2] => 608571 [3] => 608572 ) Item to remove array Array ( [0] => 608570 ) How would that be done? Is there a simple built in function for that, or do I have to foreach the arrays? Link to comment https://forums.phpfreaks.com/topic/193428-removing-array-items-using-another-array/ Share on other sites More sharing options...
Alex Posted February 26, 2010 Share Posted February 26, 2010 array_diff print_r(array_diff($array1, $array2)); Link to comment https://forums.phpfreaks.com/topic/193428-removing-array-items-using-another-array/#findComment-1018364 Share on other sites More sharing options...
Scooby08 Posted February 26, 2010 Author Share Posted February 26, 2010 Thankyou! Link to comment https://forums.phpfreaks.com/topic/193428-removing-array-items-using-another-array/#findComment-1018365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.