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;
Did you know?Explore Trending and Topic pages for more stories like this.
$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
343 Like 46 Dislike
Previous forums Next forums
Other forums

PHP - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,

This is my first time on your website and please excuse if I am asking silly que

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

issues verifying if user is logged in
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to com

Results from Db outputted twice
Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out

Help, Base64 encoding url and decoding server side.
Hello everyone, i have a website with videos and games and also provide an embed code which people c

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

Need help-Error istream header declaration
Hi Everyone ,

I am having issue with istream declaration. I am new to C programming.
can a

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means

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