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 |
Should I learn php before wordpress?
How to create the PHP Script to Calculate the Age Using the Inputs Of our Birth date and the Current date?
What software is required to run php?
what is abstrac class? why it is use?
Why sessions are used in php?
How error handling is being handled by php?
How can we display the output directly to the browser?
What is a query in php?
How to download files from an external server with code in php?
What is meant by PEAR in PHP?
What is xss in php?
Explain the importance of the function htmlentities.