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? Quote 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)); Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.