Table of Contents

array_keys

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return keys for an array that has key/value pairs

Description

array array_keys ( array $array )

Return an array object

Parameter

$array: An array with key/value pairs

Return Values

An array of keys

Example

<pre><?
  $arr=array();
  $arr['name']="John";
  $arr['age']=30;
  $arr['status']=1;
  $keys=array_keys($arr);
  print_r($keys);
?></pre>

The above example will output:

[$keys] = Array (
(string) [0] => name
(string) [1] => age
(string) [2] => status
)

See Also

array() - Create an array, with optional values

array_key() - Return the key for an array index

sizeof() - Return the number of elements in an array

print_r() - Dump the contents of an array to the current output

uPHP Variable Types and Limits