Zum Hauptinhalt springen

Encode CSV

Anatomy

<encode:csv var="var" var_result="var" delimiter=";" enclose="bool"/>

Description: ENCODE:CSV joins the items of a multidimensional array to comma-separated values.

Comma-separated values represent tabular data. Each line corresponds to a row in the table. Within a line, fields are separated by a delimiter, each field belonging to one table column.

Attributes

NameTypeDescriptionDefined By
varvarVariable name encode:csv
var_resultvarResult variable name encode:csv
delimiterstringDelimiter encode:csv
encloseboolEnclose values encode:csv

Results:

BindingTypePredicate
var_resultstringN/A

Examples

Example

<array var="names">
<array>
<item>First Name</item>
<item>Last Name</item>
</array>

<array>
<item>Bill</item>
<item>Gates</item>
</array>

<array>
<item>Steve</item>
<item>Jobs</item>
</array>
</array>

<output>
<encode:csv var="names" delimiter=";"/>
</output>

<!--
"First Name";"Last Name"
Bill;Gates
Steve;Jobs
-->