Returns the JSON representation of a value.
Usage:
{{ "red,green,blue" | split(",") | json_encode }}
Result:
["red","green","blue"]
This example demonstrates both the split and json_encode filters working together, showing how to convert a comma-separated string into a JSON array.
Leave a Reply
You must be logged in to post a comment.