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 |
Which is a perfect example of runtime polymorphism?
Explain me what are the main error types in php and how do they differ?
Is php is dying?
How to call a php function from html button?
Tell me which programming language does php resemble to?
How can we know that a session is started or not?
3 Answers Rushmore Consultancy,
How to find a specific value in an array?
Write a program to get lcm of two numbers using php?
What is the use of post in php?
How to read a file in php?
How is php different from other languages?
Tell me what is the use of isset() in php?