Core Function Insert

From Sputnik Wiki
Jump to: navigation, search
Insert( <array>, <id>, <expressions> )

Contents

Description

Add items to an array at a given location

Parameters

array

The array to use.

id

Location to insert to.

Note - If location doesnt exist it will be created and the void between arrays end and your new index will be empty strings.

expressions

One or more values to add to the array.

Return Value

Success - Returns how many elements were done.

Failure - Returns 0.

Remarks

None

Example

$array = array ( "Two", "Three" );
 
insert($array, 0, "Zero");
insert($array, 3, "Four", "Five");
 
$i = 0;
Foreach ( $array as $i )
{
	println("Element ($i) is: " . $i);
	$i++;
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox