cfdocs

arrayToStruct

Transform the array to a struct, the index of the array is the key of the struct

arrayToStruct(array)
returns struct

Member Function Syntax

array.toStruct()

Argument Reference

Name Type Required Default Description
array array Yes    

Convert an array to a struct using arrayToStruct()

serializeJSON(arrayToStruct(["a","b"]));

Expected Result: {“2”:”b”,”1”:”a”}