1.

How to get array key value in php?

Answer»

The array_keys() FUNCTION is used in PHP to RETURN with an ARRAY containing keys.
Here is the syntax for the array_keys() function: array_keys(array, value, strict)

Here is an example to demonstrate its use

$a=array("VOLVO"=>"AAAAAAAA","BMW"=>"BBBBBBB","Toyota"=>"CCCCCC");
print_r(array_keys($a));

Output:

Array ( [0] => Volvo [1] => BMW [2] => Toyota )



Discussion

No Comment Found