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 are the different data types in javascript?
What is the use of addslashes in php?
which is the best institute for php training near delhi & NCR......& what is the fee for the same....
What is the difference between "echo" and "print" in php?
what is PDO?
What is MIME?
How cookies are trported from browsers to servers?
How to add different images in php program like a job site.......
Can we use include ("xyz.php") two times in a php page "index.php"?
How can we display the output directly to the browser?
How to find out, how a user visited a particular page?
Is PHP is procedure oriented or object oriented?