array unique php by value
<?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 ) $arr = array(1, 4, 6, 1, 8, 9, 4, 6);
$unique = array_unique($arr);
$duplicates = array_diff_assoc($arr, $unique);
print_r($duplicates);
Array ( [3] => 1 [6] => 4 [7] => 6 )
Also in PHP:
- check string on string php
- create php laravel project
- Fatal error: Uncaught ReflectionException: Class config does not exist in
- create an exception php
- add days php
- associative array rev in php
- check if string contains specific string php
- create a new project laravel
- + php quantifer
- TEXT UPPER PHP
- drupal 8 date formater service
- laravel::all()->distinct()->get();
- .htacess to remove index.php on codeigniter localhost
- Which are valid PHP error handling keywords? try throw catch finally
- dompdf/dompdf v1.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- check string is present in php
- check string appear in string php
- drupal 8 enable twig debug
- debug native php
- collection empty laravel
- composer cache clean
- Syntax error or access violation: 1071 Specified key was t oo long; max key length is 1000 bytes
- cakephp find_in_set
- ci db query error