Lasso Soft Inc. > Home

[ array->reverse ]

Method

The [array->reverse] reverses all of the elements in the array so the last element is first and vice versa. The array is modified in-place and no result is returned.

  • Syntax
array->reverse
Examples
  • Beginner

Reverse the order of the elements of an array

This example takes an array of the days of the week and reverses their order within the array.

Code

var( DaysOfWeek = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') )

$DaysOfWeek->reverse

//modified array
$DaysOfWeek

Result

array(Sat, Fri, Thu, Wed, Tue, Mon, Sun)

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft