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
143 Like 34 Dislike
Previous forums Next forums
Other forums

How to assign a textbox value to PHP variable??
Hi ! Can any one help me out as quickly as possible. As I m new to PHP.
Plz tell me how to assign

Month String to Numeric?
Hi guys,

Given a month as a string, is there a simple way to find the numeric representation

creating a 1 to 100 in a table
hi guys I am a newb in php need some help.

I have a table with 1 column and 100 rows and in

user data not transferring to new page
I'm a PHP learner. After an index.php page, the user goes to a login.php page. Both pages seem to

New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code righ

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

PHP login form help (Done Most of It)
Hi i am having a problem, when i try logging in it is always saying "Invalid Login" im not

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

phpMailer will not connect using SMTP
I am trying to use phpMailer with smtp:

Code: [Select]$mailer = new PHPMailer();
$mailer-&

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