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

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

DateObject and Nulls
Hi all,

I have an array mapped to a value object. One of the items in the array is a PHP Date

big pagination problem in php
<?php

$connect = mysql_connect("localhost", "root", "")

Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year change

update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an

I need help with formatting date from mysql! with php!
Hello guys

*Note: this is a php question not MySQL question, please do not move it to mysql s

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

text box alphanumeric caracters only
hi all!

I have search on google on how to enter in a test box only caracters A-Z,a-z,0-9 usi

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