User Tools

Site Tools


uphp:functions:array_resize

Differences

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

Link to this comparison view

uphp:functions:array_resize [2021/01/28 09:36]
admin created
uphp:functions:array_resize [2021/09/13 05:57]
Line 1: Line 1:
-======array_resize====== 
- 
-<badge>WMMEGA FW >= 2.1179</badge> <badge>WM-M2 FW >= 3.1179</badge> 
- 
-Resize an indexed array 
- 
-====Description==== 
- 
-<well size="sm"><html> 
-<span style="font-size:125%;color:green"> 
-<span style="color:black">array_resize ( 
-<span style="color:green">array 
-<span style="color:blue">$array<span style="color:black">, 
-<span style="color:green">int 
-<span style="color:blue">$length 
-<span style="color:black">) 
-</html></well> 
- 
-====Parameters==== 
- 
-<html><b><span style="color:blue">$array<span style="color:black"></b>: An indexed <b><span style="color:green">array<span style="color:black"></b></html> 
- 
-<html><b><span style="color:blue">$index<span style="color:black"></b></html>: The number of elements to resize to.  If this is larger than the current size, 0 values will be inserted at the end.  If the value is smaller, the array will be chopped. 
- 
-====Return Values==== 
- 
-<html>none</html>  
- 
-====Example==== 
- 
-===Create an indexed array and resize it 
- 
-<code php> 
-<pre><? 
- 
-  $arr=indexed_array(4,100);  // array of 100 floating point values 
-   
-  // fill it up 
-  for ($i=0;$i<100;$i++) { 
-    $arr[$i]=$i; 
-  } 
-   
-  print(sizeof($arr)); 
- 
-  array_resize($arr,50); 
-  print_r($arr); 
-   
-  array_resize($arr,120); 
-  print_r($arr); 
-?></pre> 
-</code> 
- 
-The above example will output: 
-<code> 
-Key at Index 0 is name and value is John 
-Key at Index 1 is age and value is 30 
-Key at Index 2 is status and value is 1 
-</code> 
- 
-====See Also==== 
- 
-[[array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html>, with optional values 
- 
-[[array_keys()]] - Return keys for an <html><b><span style="color:green">array<span style="color:black"></b></html> that has key/value pairs 
- 
-[[sizeof()]] - Return the number of elements in an <html><b><span style="color:green">array<span style="color:black"></b></html> 
- 
-[[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/functions/array_resize.txt · Last modified: 2021/09/13 05:57 (external edit)