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 make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

Transaction variant for VA02 not working
My requirement is to have transaction for user to only add the output and print a sales order.

Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav

Legal Issues for SAP ERP o ERP in general
Hi experts,

Can someone please help me finding some documentation about legal issues tha

Cloud Computing?
Hello,

I was wondering if anyone could help explain this term to me. I'm starting to hear it

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

problem with array - multilingual page
this is my test page :
Code: <?php
if(isset($_GET['lang'])) {
if($_GET['la

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

PHP not creating file.
Its supposed to create a .ini file in the /scriptfiles/users/ with the name they entered into the fi

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