Array filter does not allow duplicate values:
<?php
$array = array(1, "hello", 1, "world", "hello");
$new=array_filter(array_count_values($array),'custom_filter');
print_r($new);
function custom_filter($val)
{
return $val > 1;
}
?>
1 — KISS (Keep It Simple, Stupid) Simplicity triumphs over complexity. Direct and clear codes are better for developing, maintaining, and s...
No comments:
Post a Comment