delete duplicates 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:
- Difference in days of two dates in php
- april 6 2010 date format php
- array_key_exists($x, $p)
- filteredduplicata php
- array key exists php after submit
- check for character in string php
- base64 image encode php
- array_reverse in php example
- /DependencyResolver/Solver.php on line 223
- cancel stripe subscription php
- exception handeling in php
- exceptionhandling php
- Notice: Array to string conversion php
- explode a number php
- check if string contain word
- convert request image as base64 string php
- dysplay message after form submit laravel
- 404 page in laravel
- $conn = new mysqli();
- base encode64 php
- currentDateTime php
- date from unix timestamp php
- check if a string is url or not php
- delete route method in laravel