CSV Encode | ENCODE_CSV

Syntax

ENCODE_CSV( [value] )

Parameters

value
An ARRAY of MAP / OBJECT values to encode.

Return Value

A CSV encoded TEXT value.

Description

Encode a value in CSV format. A header row for the csv is calculated from the provided records.

Examples

# VALUE is:
# [
#    ["id" => 1, "name" => "Amy"]
#    ["id" => 2, "name" => "Bill"],
# ]
ENCODE_CSV(VALUE)
# returns "id,name\r\n1,Amy,\r\n2,Bill"