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 better python or php?
how can i get USA time using php...
Does php 7 support multiple inheritance?
Write a program using while loop?
How can we change the maximum size of the files to be uploaded?
How to make a class in php?
Explain some of the php string functions?
What are the features and advantages of object-oriented programming in php?
code to see the priview of the image which is being uploaded (after browising the image... just click priview ... how it will be visible...before uploading)
Tell me which programming language does php resemble to?
What is the difference between for and foreach in php?
What is singleton design pattern in php?