best data structure in php for a unique values
<?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 ) function has_dupes($array) {
$dupe_array = array();
foreach ($array as $val) {
if (++$dupe_array[$val] > 1) {
return true;
}
}
return false;
}
Also in PHP:
- array_search in php
- convert upper case php
- creating seed file laravel
- convert date and time to timestamp php
- array has not key in php
- clear all cache laravle
- Api to add condition for newrelic
- "customer" attribute not getting saved from admin magento 2
- daye in php
- catch exception in php
- "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52"
- capital letter php
- convert small letter to capital in php
- end date from week number in php
- Error: Cannot redeclare composerRequire1d8e02dff94f518b7a14ddcb6710f10d() (previously declared in /Applications/XAMPP/xamppfiles/htdocs/all4learn2/Vendor/composer/autoload_real.php:66)
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1527808 bytes) i
- __dir__ in php
- close connection pdo
- check chartercount in php
- check if logged laravel
- count string length in php
- current timestamp with sec in php to strstring
- find or fail laravel
- base64decode php