answersLogoWhite

0


Best Answer

The inherit function `array_dif($arrayOne, $arrayTwo, $arrayThree, ...)` is likely what you're looking for. It compares two or more arrays, and returns an array of values that are unique among the arrays.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get difference between two or more arrays in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a PHP function that can sort arrays by other arrays?

You cannot sort arrays by other arrays; that wouldn't make sense, anyway.


What is the difference between POST and REQUEST methods in PHP?

The $_POST array contains only variables supplied by a form that used the POST method, while the $_REQUEST array combines the $_POST, $_GET and $COOKIE arrays.


Difference between apache and PHP?

Apache is a web server. PHP is a scripting language.


Difference between jsp and php?

JSP stands for Java Server Pages whereas PHP stands for Hypertext PreProcessor. PHP is a scripting language whereas JSP is a full fledged technology. JSP is much more powerful and has more features than PHP


What is the PHP foreach construct used for?

The PHP foreach construct is used to iterate over arrays. This is done in the field of mathematics. It will issue errors when one tries to use it as a variable instead of arrays and objects.


How are arrays different in languages other than PHP?

There aren't any (at least none that I'm aware of). In PHP arrays are the same as in all other languages: variables that contain several values at different indices.The only difference between PHP and certain other languages is the way a variable is initialised as an array:$example = array(index => value, index2 => value2);Contrary to other languages, this is similar to a function, as opposed to creating an instance of a class. (JavaScript for example: xyz = new Array();)


How do you merge arrays in PHP?

To merge arrays in PHP all you have to do is use the array_merge() function like shown below: <?php $array1 = array("Matt", "Michael", "Justin"); $array2 = array("Janice", "Janet", "Kylie"); $array3 = array_merge($array1, $array2); ?> One thing to remember when merging arrays is you might be creating duplicate results, if you don't want 2 or more of the same result in the array remember to use the function array_unique() to remove the duplicate results from it!


What language supports associative arrays?

AWK, Perl and PHP are three examples.


What is the importance of foreach loop in php?

The foreach construct simply gives an easy way to iterate over arrays. Foreach works only on arrays (and objects).


What is the difference between PHP4 and PHP5?

they are the same, but php 5 has improvements in design, security, and stablity. it is basically a new version. if you want more details just go to http://www.php.net and find the recent changes in php.


What is the difference between PHP and struts?

STRUTs is a framework of technology of java based on JSP/Java Servlets PHP is another server scripting language


What is the difference between PHP and JSP?

They are different technologies - JSP stands for Java Server Pages, where PHP means PHP: Hypertext Preprocessor... Basically, they do the same thing - generate webpages, but JSP scripts are programmed in Java, and PHP scripts in PHP, which are completely different scripting languages. PHP is usually used in small to medium-sized projects, where Java tends to be percieved as a more "enterprisey" (aimed at large projects).