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
343 Like 46 Dislike
Previous forums Next forums
Other forums

Unable to customise toolbar in FCK
Facebook status update API
Hello,

So, I'm trying to create my first Facebook application with PHP.

Basic ideas fo

OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

PHP using IF to display error
i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1

Require select-option functionality in Module Pool Programming
Hi Gurus,

I am doing a development by Module Pool on Warehouse Management. For that devel

order by date not ID number help php
I am trying to orginize the following code to order by date not id number.
any help would be grea

How to grab certain words ??
I am working with this API

Returns JSON.
curl http://letsbetrends.com/api/current_trends

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