array_unique( array_merge($arr_1, $arr_2) );
or you can do:
$arr_1_final = array_diff($arr_1, $arr_2);
$arr_2_final = array_diff($arr_2, $arr_1);
More Related Contents:
- How to make array inside in foreach loop – php? [closed]
- How do search array values and remove them based on a condition or string? [closed]
- How can I sort arrays and data in PHP?
- How to Flatten a Multidimensional Array?
- Sort array of objects by object fields
- Get the first element of an array
- + operator for array in PHP?
- How to push both value and key into PHP array
- PHP Array to JSON Array using json_encode(); [duplicate]
- How to create an array from a CSV file using PHP and the fgetcsv function
- How can I check if an array contains a specific value in php?
- How to reindex an array?
- array_splice() for associative arrays
- How to sort an array of UTF-8 strings?
- Is it necessary to declare PHP array before adding values with []?
- Explode a string to associative array without using loops? [duplicate]
- Casting an Array with Numeric Keys as an Object
- How to split a long string without breaking words?
- How to trim white spaces of array values in php
- How to get all combinations from multiple arrays?
- PHP Array Syntax Parse Error Left Square Bracket “[” [closed]
- What’s the difference between array_merge and array + array? [duplicate]
- PHP: do arrays have a maximum size?
- How do I use array_unique on an array of arrays?
- How to count non-empty entries in a PHP array?
- Is there a way to loop through a multidimensional array without knowing it’s depth?
- Merge two 2d arrays by shared column value
- How to implode array with key and value without foreach in PHP
- Access first level keys with array_map() without calling `array_keys()`
- How to convert array values to lowercase in PHP?