This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:array [2017/03/28 17:33] jeff |
uphp:functions:array [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======array====== | ======array====== | ||
+ | |||
< | < | ||
- | Create an array, with optional values | + | Create an < |
====Description==== | ====Description==== | ||
- | <well size=" | ||
- | <span style=" | ||
- | < | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | </ | ||
- | Return an array object | + | <well size=" |
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | </ | ||
====Parameters==== | ====Parameters==== | ||
- | < | ||
- | ====Return | + | < |
- | Array of values | + | |
+ | ====Return | ||
+ | |||
+ | < | ||
====Examples==== | ====Examples==== | ||
- | **Creating Arrays:** | + | |
+ | ===Creating Arrays=== | ||
<code php> | <code php> | ||
Line 37: | Line 40: | ||
</ | </ | ||
- | **Key/Value Pairs:** | + | ===Key/Value Pairs=== |
<code php> | <code php> | ||
Line 60: | Line 63: | ||
====Note==== | ====Note==== | ||
- | An [[indexed array]] is a more efficient way to store variables in memory if the size and data type is known beforehand. The [[array()]] function creates a hashed array, which consumes much more memory per element. | + | |
+ | An [[indexed array]] is a more efficient way to store variables in memory if the size and data type is known beforehand. The [[array()]] function creates a hashed | ||
====See Also==== | ====See Also==== | ||
- | [[indexed_array()]] - Create an array of a specific type and size | ||
- | [[sizeof()]] - Return the number of elements in an array | + | [[indexed_array()]] - Create an < |
+ | |||
+ | [[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 < |
- | [[array_key()]] - Return the key for an array index | + | [[array_key()]] - Return the key for an < |
- | [[array_keys()]] - Return keys for an array that has key/value pairs | + | [[array_keys()]] - Return keys for an < |
[[uphp: | [[uphp: | ||