duplicate array values php
function has_dupes($array) {
$dupe_array = array();
foreach ($array as $val) {
if (++$dupe_array[$val] > 1) {
return true;
}
}
return false;
}$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:
- 1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")
- convert timestamp to readable date and time
- check if word include string
- dates and time php
- capitalized string in php
- create symfony project
- check if string has a string php
- disable register auth laravel
- e error reporting all
- error message in php
- :user="{{auth()->user()}}
- change the format of date c#
- $this->db->where codeigniter result
- composer instal laravel
- Your Composer dependencies require the following PHP extensions to be installed: fileinfo
- : Allowed memory size of 268435456 bytes exhausted (tried to allocate 77155656 bytes) in /home/gergstor/public_html/seo/application/third_party/MX/Loader.php on line 373 A PHP Error was encountered Severity: Error Message: Allowed memory size of
- check variable data type with value in php
- Check password match laravel
- download data from s3 and save to local disk laravel
- Call to a member function diffForHumans() on null (View: C:\xampp\htdocs\basic\resources\views\dashboard.blade.php)
- download laravel composer
- find strings that contain php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/composer/composer.phar/s
- array_add laravel 7