What does array_keys() function in php.?
The array_keys() function returns an array containing the keys.
Syntax of array_keys() function:
array_keys(array,value,strict)
So, there are three main Parameter of array_keys().
These are following:
1-array(this is used for specifying an array)
2-Value(this is used for specifying the value)
3-strict( This is optional and used with the value parameter)
You can take reference form below example to use of array_keys() function in php.
<?php
//here GetName is variable of array
$GetName=array("Surya"=>"ab10","Nancy"=>"bc20","Tom"=>"de30");
//here call the array_keys() and print data
print_r(array_keys($GetName));
?>
Output of above code will be as following:-
Array ( [0] => Surya [1] => Nancy [2] => Tom )
0 Comment(s)