This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
uphp:functions:sizeof [2017/03/28 20:20] jeff |
uphp:functions:sizeof [2017/04/12 13:02] jeff |
||
---|---|---|---|
Line 1: | Line 1: | ||
======sizeof====== | ======sizeof====== | ||
+ | |||
< | < | ||
- | Return the number of elements in an array | + | Return the number of elements in an < |
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | < |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | </ |
- | </ | + | [[sizeof]] |
+ | < | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | <span style=" | ||
+ | </ | ||
+ | </ | ||
====Parameter==== | ====Parameter==== | ||
- | < | + | |
+ | <html><b>< | ||
====Return Value==== | ====Return Value==== | ||
- | Number | + | |
+ | < | ||
====Examples==== | ====Examples==== | ||
Line 60: | Line 69: | ||
Multidimensional arrays are not counted recursively, | Multidimensional arrays are not counted recursively, | ||
- | As can be seen from the examples, uPHP always returns 0 for objects which are not arrays (mainline PHP will return 1 in some cases). If you are not certain the object is an array it is best to first use function [[is_array()]]. | + | As can be seen from the examples, uPHP always returns 0 for objects which are not arrays (mainline PHP will return 1 in some cases). If you are not certain the object is an < |
====See Also==== | ====See Also==== | ||
- | [[array()]] - Create an array, with optional values | ||
- | [[array_key()]] - Return the key for an array index | + | [[array()]] - Create an < |
+ | |||
+ | [[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 < |
- | [[explode()]] - Turn a string into an array | + | [[explode()]] - < |
- | [[implode()]] - Turn an array into a string | + | [[implode()]] - < |
- | [[indexed_array()]] - Create an array of a specific type and size | + | [[indexed_array()]] - Create an < |
- | [[is_array()]] - Return 1 if the variable is an array | + | [[is_array()]] - Check if a variable is an < |
- | [[json_encode()]] - JSON encode an array into a string, with optional method | + | [[json_encode()]] - < |
- | [[print_r()]] - Dump the contents of an array to the current output | + | [[print_r()]] - Dump the contents of an < |
[[uphp: | [[uphp: | ||