duplicate in array in 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:
- check if table exists sql php
- create controller in laravel command line
- debugbar:clear in laravel
- client_ip() function php
- [WAR] df (lib\peer.php:164) file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
- check if substring is present in string php
- array_uniqe php
- class in php
- convert ip to latitude longitude using php
- Authorization header (API Key) is missing" }in guzzle
- array_sum in multidimensional array php
- find str in string php
- Increase execution time of server
- display page template using functions.php
- base64 php
- array key exists and is true
- clear cache in laravel
- Get last id in laravel
- date phhp
- check if includes numbers php
- composer set php version
- composer artisan
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://D:/Program Files/Composer - PHP/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- activity log spatie