delete repeated elements array 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:
- $heure = date('H'); php 5
- check variable type in php
- check a symbol exist php
- date format php keep string
- Your Composer dependencies require a PHP version ">= 7.2.5". You are running 7.2.0. in
- all words capital php
- base decode php
- PHP Warning: Module 'soap' already loaded in Unknown on line 0
- .net base64 encode decode in php
- apache php e_warnings e_notice off
- ation: 1071 Specified key was too long; max key length is 1000 bytes
- PHP format date in string
- base64 dencode GET variables in PHP
- create date from string php
- br2nl
- 30 numbers random string in php
- echo header in php
- Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query laravel
- Warning: sprintf(): Too few arguments in /opt/lampp/htdocs/wordpress/wp-admin/includes/class-bulk-upgrader-skin.php on line 152
- date("l") php
- check sizee string laravel
- display datetime in php
- Created Migration: laravel
- clear cache is not working laravel