count duplicate in array and delete using 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:
- date'G')
- clear storage laravel
- #1071 - Specified key was too long; max key length is 767 bytes voyger laravel
- blog post page is_home
- In Connection.php line 1262: Class 'PDO' not found
- auto generate password in php on button click
- catch multiple exceptions php
- contain string php
- autoload file in laravel
- drop down list display only seleted item only
- contain in string php
- find position of character in string php
- check array key e\
- add one day to date in php
- display file error php
- create date from string php
- collapse and expand phpstorm
- check if id is in key array php
- check number is positive or negative in php
- count string php
- 'https://', 'www.' & all sub derictories reomve from a url with regex
- 3 elements in do while loop php
- date - Manual - PHPwww.php.net › manual › function.date.phpdate ( string $form
- SSL operation failed with code