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 |
Can you define an argument as a reference type?
Which php function will attach one file to another?
What is deffience betwwen get() , Post , Request()
List out the predefined classes in PHP?
Which parts of php are case sensitive?
What is the default session time in php?
Tell me what is the difference between ereg_replace() and eregi_replace()?
Is php difficult to learn?
Is null check in php?
In php, how to redirect from one page to another page?
Do csrf tokens expire?
Can you define an array argument as a reference type?