Skip to content

Instantly share code, notes, and snippets.

@smunchi
Created November 2, 2021 11:07
Show Gist options
  • Select an option

  • Save smunchi/4f0aab1990fbf1ec7045cb285fa8067a to your computer and use it in GitHub Desktop.

Select an option

Save smunchi/4f0aab1990fbf1ec7045cb285fa8067a to your computer and use it in GitHub Desktop.
How to remove duplicate frequnecy in php array data
$arrayData = [2,2,2,5];
$filterData = array_filter(array_count_values($arrayData), function ($value) {
return $value == 1;
});
print_r($filterData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment