array no of duplictae items 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 ) <?php
$input = array("a" => "green", "red", "b" => "green", "blue", "red");
$result = array_unique($input);
print_r($result);
?>
Array
(
[a] => green
[0] => red
[1] => blue
)
Also in PHP:
- create database seeder in laravel
- call a seeder in databaseseeder laravel
- Malformed UTF-8 characters, possibly incorrectly encoded
- check key exists in array in php
- create new directory php
- cache clear in laravel command
- check if string contains letter php
- artisan run seeder
- Undefined offset: 0 at laravel\framework\src\Illuminate\Routing\Router.php
- filter elementor
- current php date
- file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages 3
- find char in string php
- control string length php
- clear firebase cacheweb hosting
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t oo long; max key length is 767 bytes
- Best IDE for php
- character count php
- How do I get a YouTube video thumbnail from the YouTube API?
- date n in php
- delete route method in laravel
- 4random numbers php
- Your Composer dependencies require a PHP version ">= 7.2.0".
- datetime to string php