Determines the number of elements in an array.
CFML MX: this function can be used on child XML objects.

arrayLen(array) → returns Numeric

Member Function Syntax


arrayLen Argument Reference

array Array

An array which to determine length

Examples sample code invoking the arrayLen function

Simple example for arrayLen function

Uses the arrayLen function to get the total length of an array

numberArray = [1,2,3,4];

Expected Result: 4

Total length of an array using the member function

CF 11+ Lucee 4.5+ Uses the len member function is the same as running arrayLen.

colorArray = ['Green','red','blue'];

Expected Result: 3

Fork me on GitHub