Serializes the object to a specified type
serialize( objToBeSerialized, type, useCustomSerializer );
→ returns string
true
Lucee 5+ This function will serialize the object to a specified type using ColdFusion's default serialization mechanism.
serialize({ "firstName": "John", "lastName": "Doe" });
Expected Result: {"lastName":"Doe","firstName":"John"}
CF 11+ This function will serialize the object to a specified type using ColdFusion's default serialization mechanism.
serialize({ "firstName": "John", "lastName": "Doe" }, 'json');
Expected Result: {"lastName":"Doe","firstName":"John"}