User Tools

Site Tools


uphp:functions:sizeof

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:sizeof [2017/03/28 17:37]
jeff
uphp:functions:sizeof [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======sizeof====== ======sizeof======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return the number of elements in an array+Return the number of elements in an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">int + 
-<span style="color:black;"></html>[[sizeof]] +<well size="sm"><html> 
-<html>+<span style="font-size:125%;color:green">int 
-<span style="color:green;">array +<span style="color:black">sizeof ( 
-<span style="color:blue;">$array +<span style="color:green">array 
-<span style="color:black;">)+<span style="color:blue">$array 
 +<span style="color:black">)
 </html></well> </html></well>
  
 ====Parameter==== ====Parameter====
-<html><span style="color:blue;"><b>array</b><span style="color:black;"></html>:  Any array object 
  
-====Return Value==== +<html><b><span style="color:blue">$array<span style="color:black"></b>:  Any <b><span style="color:green">array<span style="color:black"></b> object</html> 
-Number of elements in the array+ 
 +====Return Values==== 
 + 
 +<html><b><span style="color:green">Integer<span style="color:black"></b> number of elements in the <b><span style="color:green">array<span style="color:black"></b></html>
  
 ====Examples==== ====Examples====
Line 60: Line 64:
 Multidimensional arrays are not counted recursively, i.e., each element which is an array adds '1' to the total count of elements (see above example). Multidimensional arrays are not counted recursively, i.e., each element which is an array adds '1' to the total count of elements (see above example).
  
-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 <html><b><span style="color:green">array<span style="color:black"></b></html> it is best to first use function [[is_array()]].
  
 ====See Also==== ====See Also====
-[[array()]] - Create an array, with optional values 
  
-[[array_key()]] - Return the key for an array index+[[array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html>, with optional values 
 + 
 +[[array_key()]] - Return the key for an <html><b><span style="color:green">array<span style="color:black"></b></html> index
  
-[[array_keys()]] - Return keys for an array that has key/value pairs+[[array_keys()]] - Return keys for an <html><b><span style="color:green">array<span style="color:black"></b></html> that has key/value pairs
  
-[[explode()]] - Turn a string into an array+[[explode()]] - <html>Turn a <b><span style="color:green">string<span style="color:black"></b> into an <b><span style="color:green">array<span style="color:black"></b></html>
  
-[[implode()]] - Turn an array into a string+[[implode()]] - <html>Turn an <b><span style="color:green">array<span style="color:black"></b> into a <b><span style="color:green">string<span style="color:black"></b></html>
  
-[[indexed_array()]] - Create an array of a specific type and size+[[indexed_array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html> of a specific type and size
  
-[[is_array()]] - Return 1 if the variable is an array+[[is_array()]] - Check if variable is an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
-[[json_encode()]] - JSON encode an array into a string, with optional method+[[json_encode()]] - <html>JSON encode an <b><span style="color:green">array<span style="color:black"></b> into a <b><span style="color:green">string<span style="color:black"></b>, with optional method</html>
  
-[[print_r()]] - Dump the contents of an array to the current output+[[print_r()]] - Dump the contents of an <html><b><span style="color:green">array<span style="color:black"></b></html> to the current output
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/sizeof.1490722654.txt.gz · Last modified: 2021/09/13 05:56 (external edit)