duplicated items in array php
<?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:
- cors header ‘access-control-allow-origin’ missing IN PARTICULAR CAKEPHP API
- date format H:i:s php
- check composer php verison
- composer require laravel
- excerpt custom post type
- array with files content in a folder
- expression is not allowed as parameter
- date( c time()) php
- PHP string mask day-year
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 157 bytes) in C:\wamp64\scripts\refresh.php on line 2263
- debuggin native php
- check if string contains only one word
- array unique in php using a column
- How can I install php7.4 on Ubuntu 18.04?
- : Allowed memory size of 41943040 bytes exhausted (tried to allocate 3072 bytes) i
- add seeder laravel
- error reportin gall in php
- create random unique password with php
- encryption and decryption in php example
- fget length of string php
- catch error php
- anandsiddharth/laravel-paytm-wallet paytm gateway integration
- add a snippet in twig shopware 6
- create php laravel project