array value unique 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:
- +1 day in while php
- custom post type with taxonomy
- big int php
- convert dd/mm/yyyy to yyyy-mm-dd in mysql php
- current time input field in laravel form
- ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in
- cart icon in woocommerce
- defaultstringlength(191)
- date("Y/m/d h:i:s") php
- Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes
- $get url php
- create new project in laravel
- curl_multi_exec
- Illuminate\Contracts\Container\BindingResolutionException Target class [HomeController] does not exist.
- $headder in php
- check key in array php
- check if substring is present php
- check if string contains substring php
- Created Migration: laravel
- catching error php
- adding days to time value in php
- add custom helper laravel
- execution time exentd php
- check key exists in associative array in php