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

General discussion on PHP

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

Postby ashi4275 on 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.
ashi4275
 
Posts: 15
Joined: Fri Jul 15, 2016 10:02 am

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

Postby scottgcampbell on Mon Sep 12, 2016 1:15 pm

You are looking for array_diff

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

Scott
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?

Postby amar9450 on 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 $... ] )
amar9450
 
Posts: 11
Joined: Wed Aug 03, 2016 6:02 am
Location: USA


Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests