Core Function Clear

From Sputnik Wiki
Jump to: navigation, search
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