This is an old revision of the document!
WMMEGA FW >= 2.1179 WM-M2 FW >= 3.1179
Resize an indexed array
$array: An indexed array
$index: 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.
none
===Create an indexed array and resize it
<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>
The above example will output:
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
array() - Create an array, with optional values
array_keys() - Return keys for an array that has key/value pairs
sizeof() - Return the number of elements in an array
print_r() - Dump the contents of an array to the current output