How to get difference between two or more arrays in PHP?

General discussion on PHP
Post Reply
ashi4275
Posts: 15
Joined: Fri Jul 15, 2016 10:02 am

How to get difference between two or more arrays in PHP?

Post by ashi4275 » Mon Sep 12, 2016 11:36 am

Hello everyone , i have an IT project lined up regarding the PHP Programming. I would like to know that how to find out the difference between two or more arrays which is based upon key and value of arrays. I am also searching for various development forum that can help me in my IT project.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: How to get difference between two or more arrays in PHP?

Post by scottgcampbell » Mon Sep 12, 2016 1:15 pm

You are looking for array_diff

http://php.net/manual/en/function.array-diff.php

Scott

amar9450
Posts: 11
Joined: Wed Aug 03, 2016 6:02 am
Location: USA
Contact:

Re: How to get difference between two or more arrays in PHP?

Post by amar9450 » Wed Sep 14, 2016 6:42 am

You can get difference between two arrays from array_diff function.
Syntax of it.
array array_diff ( array $array1 , array $array2 [, array $... ] )

Post Reply