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 |
Tell me what is the use of explode() function?
Explain how can php and javascript interact?
display selected value in dropdown list through javascript without page refresh
What is a php namespace?
How do you register one session ?
Which is better php praogramming or cad/cam scope wise and also salaray wise?
Which methods should be used for sending an email using the variables $to, $subject, and $body?
Inside a php function, what param needs to be set in order to access a global variable?
What is a procedure in php?
What is fulltextsearch
How does php work?
What is helper library?