array deduplicate in 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:
- check if character is in string php
- cache clear of app.php laravel
- change css in php
- artisan run seeder
- current server in laravel
- file_get_contents(): SSL: The operation completed successfully but file_get_contents(http://www.b2bsoftwareking.com): failed to open stream: No connection could be made because the target machine actively refused it. in
- error showing in php
- check if string like string
- Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add index `users_userable_type_userable_id_index`(`userable_type`, `userable_id`)
- connect an if statement to an input php
- define header in php
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long
- add another field in existing migration laravel
- date en php
- changing php version in composer in server
- adding days in date, php
- find if substring is in string php
- base64_decode image string php
- datetime get month php
- create your first laravel project
- Installation request for pokemon-tcg/pokemon-tcg-sdk-php ^1.2 -> satisfiable by pokemon-tcg/pokemon-tcg-sdk-php[1.2.0]
- convert base64 to file php
- code cache laravel
- check if string contains only one word