Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is there any function to find repeated value in an array?
What is w2 standard

Answer Posted / amitverma

Yes, there's a function for everything in PHP :)
To see the repeated values in an array you may use function
array_count_values($array);

This function will return you an array, consisting each
vaule's frequency associated with it.


##
#Following Code -

$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));

##
#Outputs -

Array
(
[1] => 2
[hello] => 2
[world] => 1
)

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between post and put in rest?

1066


What are the types of variables in php?

1111


What is trim function in php?

1125


How do you count numbers in php?

1011


What is the difference between pop3 IMAP and MAPI?

1112


Whether php supports microsoft sql server?

1109


How to know user has read the email-php?

999


Is php worth learning in 2019?

957


Tell me how to get the value of current session id?

999


What is die in php?

1103


How to get the length of string?

1079


What is abstract class php?

980


What is the meaning of a final class and a final method?

1164


How do I clear my browser session?

1085


What function should you use to join array elements with a glue string?

1022