ArrayToStruct()
Transform the array to a struct, the index of the array is the key of the struct
ArrayToStruct( array=array );
Returns: Struct
Examples
Simple Array
arr = ['a','b','c','d','e','f','g'];
dump(arrayToStruct(arr));
//member function
dump(arr.toStruct());
Array of Structs
arr = [
{name:'a'},
{name:'b'},
{name:'c'},
{name:'d'},
{name:'e'}
];
dump(arrayToStruct(arr));
//member function
dump(arr.toStruct());
See also
- Arrays
- Structures
- array.toStruct()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)