Core Function Shift

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Shift( <array> ) </pre> === Description === Delete the last item in an array. === Parameters === ==== array ==== The array to use. === Return Value === Success - Ret...")
 
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
  
Delete the last item in an array.
+
Delete the first item in an array.
  
 
=== Parameters ===
 
=== Parameters ===

Revision as of 20:40, 19 April 2012

Shift( <array> )

Contents

Description

Delete the first item in an array.

Parameters

array

The array to use.

Return Value

Success - Returns the shifted object.

Failure - Returns 0.

Remarks

None

Example

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