Answers for "get same values from array php"

PHP
18

php remove duplicates from array

<?php
$fruits_list = array('Orange',  'Apple', ' Banana', 'Cherry', ' Banana');
$result = array_unique($fruits_list);
print_r($result);
?>
  
Output:

Array ( [0] => Orange [1] => Apple [2] => Banana [3] => Cherry )
Posted by: Guest on March-04-2020
1

php array merge skip diplicate

You can use the PHP array_unique() function and PHP array_merge() function together to merge two arrays into one array without duplicate values in PHP.
Posted by: Guest on December-16-2020

Code answers related to "get same values from array php"

Browse Popular Code Answers by Language