WMPRO, WMMINI FW >= 1.953 WMMEGA FW >= 2.0
Return the key for an array index
$array: An array with key/value pairs
$index: The index for the array element (the first element is index 0)
String containing the key name of the array element at the specified index
<pre><? $arr=array(); $arr['name']="John"; $arr['age']=30; $arr['status']=1; for ($i=0; $i < sizeof($arr); $i++) { $key=array_key($arr,$i); print("Key at Index ".$i." is ".$key." and value is ".$arr[$key]."\r\n"); } ?></pre>
The above example will output:
Key at Index 0 is name and value is John Key at Index 1 is age and value is 30 Key at Index 2 is status and value is 1
array() - Create an array, with optional values
array_keys() - Return keys for an array that has key/value pairs
sizeof() - Return the number of elements in an array
print_r() - Dump the contents of an array to the current output