# \[PHP\] remove one array from another

**URL:** <https://forum.kirupa.com/t/php-remove-one-array-from-another/121502>\
**Category:** Uncategorized\
**Created:** [September 3, 2004, 9:26am UTC](https://forum.kirupa.com/t/php-remove-one-array-from-another/121502 "2004-09-03T09:26:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![koorb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/koorb/32/424_2.png) [@koorb](https://forum.kirupa.com/u/koorb)\
**Post date:** [September 3, 2004, 9:26am UTC](https://forum.kirupa.com/t/php-remove-one-array-from-another/121502/1 "2004-09-03T09:26:32Z")

</div>

for example:

$array1 = array(‘foo’, ‘bar’);  
$array2 = array(‘foo’, ‘bar’, ‘donkeywings’);

now I want to take the values of $array1 out of $array2, I know this can be done using while and in\_array etc. but is there an array function to this straight off, I have had a look on [php.net](http://php.net), but cant see anything, just wondered if anyone had something on the top of thier head.

thanks much…  
peace!
