User Tools

Site Tools


uphp:functions:indexed_array

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:functions:indexed_array [2017/03/27 19:43]
jeff created
uphp:functions:indexed_array [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======indexed_array====== ======indexed_array======
 +
 <badge>WMPRO, WMMINI FW >= 1.898</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.898</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Create an array of a specific type and size+Create an <html><b><span style="color:green">array<span style="color:black"></b></html> of a specific type and size
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">array + 
-<span style="color:black;"></html>[[indexed_array]] +<well size="sm"><html> 
-<html>+<span style="font-size:125%;color:green">array 
-<span style="color:green;">int +<span style="color:black">indexed_array ( 
-<span style="color:blue;">$type<span style="color:black;">, +<span style="color:green">int 
-<span style="color:green;">int +<span style="color:blue">$type<span style="color:black">, 
-<span style="color:blue;">$size +<span style="color:green">int 
-<span style="color:black;">)+<span style="color:blue">$size 
 +<span style="color:black">)
 </html></well> </html></well>
  
-Create an indexed array with the specified type and number of elements. 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.+Create an indexed <html><b><span style="color:green">array<span style="color:black"></b></html> with the specified type and number of elements. 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.
  
 ====Parameters==== ====Parameters====
-<html><span style="color:blue;"><b>type</b><span style="color:black;"></html>:  1=byte, 2=short, 3=int, 4=float+ 
 +<html><b><span style="color:blue">$type<span style="color:black"></b></html>:  1=byte, 2=short, 3=int, 4=float
   * Type 1: Array of bytes   * Type 1: Array of bytes
   * Type 2: Array of short integers (16 bits)   * Type 2: Array of short integers (16 bits)
Line 24: Line 27:
   * Type 4: Array of floating point numbers   * Type 4: Array of floating point numbers
  
-<html><span style="color:blue;"><b>size</b><span style="color:black;"></html>:  The number of elements in the array+<html><b><span style="color:blue">$size<span style="color:black"></b>:  The number of elements in the <b><span style="color:green">array<span style="color:black"></b></html>
  
-====Return Value==== +====Return Values==== 
-Indexed array+ 
 +Indexed <html><b><span style="color:green">array<span style="color:black"></b></html>
  
 ====Example==== ====Example====
 +
 <code php> <code php>
 <?  <? 
Line 37: Line 42:
  
 ====Note==== ====Note====
-There are no named keys in an indexed array, all elements are referenced by the index number. The first element is index=0, and the last element is index=<html><span style="color:blue;">$size<span style="color:black;"></html>-1.+ 
 +There are no named keys in an indexed array, all elements are referenced by the index number. The first element is index=0, and the last element is index=$size-1.
  
 ====See Also==== ====See Also====
-[[array()]] - Create an array with values+ 
 +[[array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html>, with optional values
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/indexed_array.1490643827.txt.gz · Last modified: 2021/09/13 05:56 (external edit)