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/31 13:24] jeff |
uphp:functions:array [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
< | < | ||
- | Create an array, with optional values | + | Create an < |
====Description==== | ====Description==== | ||
- | <well size=" | + | <well size=" |
- | <span style=" | + | <span style=" |
- | < | + | <span style=" |
<span style=" | <span style=" | ||
<span style=" | <span style=" | ||
Line 17: | Line 17: | ||
====Parameters==== | ====Parameters==== | ||
- | < | + | <html><b>< |
- | ====Return | + | ====Return |
- | Array, empty or with values as specified | + | < |
====Examples==== | ====Examples==== | ||
- | **Creating Arrays:** | + | ===Creating Arrays=== |
<code php> | <code php> | ||
Line 40: | Line 40: | ||
</ | </ | ||
- | **Key/Value Pairs:** | + | ===Key/Value Pairs=== |
<code php> | <code php> | ||
Line 64: | Line 64: | ||
====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 | + | [[indexed_array()]] - Create 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 < |
- | [[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: | ||