Remove values in array2 from array1


Posted on 16th Feb 2014 07:03 pm by admin

I have two arrays.

Array 1 is where the array key holds various different numbers. For example:
Code: [Select]$array[32] = 1;
$array[122] = 1;
$array[238] = 1;
$array[324] = 1;

The other array holds values in the same way (but may have less values in total):
Code: [Select]$array[238] = 1;
$array[287] = 1;

I want to simply remove any values in array 2 from array 1 (so now array 1 simply holds 32, 122 and 324).

I am sure there is a quick array command that does this - so I won't need to use a foreach loop.

No comments posted yet

Your Answer:

Login to answer
143 Like 34 Dislike
Previous forums Next forums
Other forums

Loop Through Date Range
Hi guys,
I have date range as parameter like 01/JAN/2009 TO 16/JAN/2009 now i want to loop thro

Expandable Post Code
Hi,

Hope you can help. Which currently I haven't upgraded to connect to a mysql server, so i

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

Java API in PHP?
I have an application that we use internally here at the office.

The software company provide

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

Mysql error message
help me find out what this error message means:

"Duplicate entry '0' for key 'PRIMARY'&q

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash