This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:array_keys [2017/03/01 11:38] jeff |
uphp:functions:array_keys [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======array_keys====== | ======array_keys====== | ||
+ | |||
< | < | ||
- | Return keys for an array that has key/value pairs | + | Return keys for an < |
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
+ | <span style=" | ||
</ | </ | ||
- | Return an array object | ||
- | ====Parameters==== | + | Return an <html><b>< |
- | An < | + | |
- | ====Return | + | ====Parameter==== |
- | An array of keys | + | |
+ | < | ||
+ | |||
+ | ====Return | ||
+ | |||
+ | An < | ||
====Example==== | ====Example==== | ||
- | <code php>< | ||
- | $arr=array(); | ||
- | $arr[' | ||
- | $arr[' | ||
- | $arr[' | ||
- | $keys=array_keys($arr); | ||
- | print_r($keys); | ||
- | ></ | ||
- | The above example will output: | ||
<code php> | <code php> | ||
+ | < | ||
+ | $arr=array(); | ||
+ | $arr[' | ||
+ | $arr[' | ||
+ | $arr[' | ||
+ | $keys=array_keys($arr); | ||
+ | print_r($keys); | ||
+ | ?></ | ||
+ | </ | ||
+ | |||
+ | The above example will output: | ||
+ | < | ||
[$keys] = Array ( | [$keys] = Array ( | ||
(string) [0] => name | (string) [0] => name | ||
Line 40: | Line 48: | ||
====See Also==== | ====See Also==== | ||
- | [[array()]] - Create an array with values | ||
- | [[array_key()]] - Return the key for an array index | + | [[array()]] - Create an < |
+ | |||
+ | [[array_key()]] - Return the key for an < | ||
- | [[sizeof()]] - Return the number of elements in an array | + | [[sizeof()]] - Return the number of elements in an < |
- | [[print_r()]] - Dump the contents of an array to the current output | + | [[print_r()]] - Dump the contents of an < |
[[uphp: | [[uphp: | ||