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 |
What types of loops exist in php?
Explain me what is the difference between explode() and split() functions?
Name and explain five of the PHP error constants?
What is PHP? Who is the father or inventor of PHP?
What is htaccess in php?
What is an associative array?
Hello Friends,I am seeking for a job in php having 2yrs. exp.Please suggest any company openings.
What are the different opening and closing tags available in PHP?
What does the php error 'parse error in php - unexpected t_variable at line x' means?
What kind of variable is age?
What is inheritance in php?
why we used type-pool SLIS in ALVs? how many types of windows in scripts?