Is there any function to find repeated value in an array?
What is w2 standard
Answer / 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 |
How to remove duplicate values from a PHP Array?
What is the functionality of md5 function in php?
What is implode() in php?
what is code for email sending through localhost pc..?
What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
What is a http session?
Which cryptographic extension provide generation and verification of digital signatures?
programm for factorial
How to get length of an array in PHP?
How to get the value of current session id?
What is the function of mysql_real_escape_string in php?
Do you know how can we check the value of a given variable is a number?