Core Function Clear

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Clear( <array>, <flag> ) </pre> === Description === Remove all items from an array. === Parameters === ==== array ==== The array to clear. ==== flag ==== Optional; W...")
 
m (1 revision)
 
(One intermediate revision by one user not shown)

Latest revision as of 12:37, 14 June 2015

Clear( <array>, <flag> )

Contents

Description

Remove all items from an array.

Parameters

array

The array to clear.

flag

Optional; What type of clear to do?

0 = Clear the array and wipe all its elements (same as Unset())

1 = Clear the array but do nothing to its elements other than remove them from the array (no wipe/delete/modify takes place).

Default: 0

Return Value

Success - true.

Failure - false.

Remarks

None.

Example

$days = Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
 
# Before Clear
printr $days;
 
Clear($days);
 
# After Clear
printr $days;
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox