Serializes the object to a specified type
serialize( object, type, useCustomSerializer )
→ returns string
true
Lucee 5+ This will serialize the object using the default serialization mechanism.
serialize({ "firstName": "John", "lastName": "Doe" });
Expected Result: {"lastName":"Doe","firstName":"John"}
This will serialize the object to JSON using ColdFusion's default serialization mechanism.
serialize({ "firstName": "John", "lastName": "Doe" }, 'json');
Expected Result: {"lastName":"Doe","firstName":"John"}
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.