Fri, 17 May 2024


How to count all the values of an array using the array_count_values PHP function?

By: Nathalie, NetArt Media
Fri, 16 October 2020

<?php

$arr=array("netart","france","paris","netart","paris");
array_count_values($arr); // will return array("netart"=>2,"paris"=>2,"france"=>1)


?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox