array

1.0 1.1 1.2 1.3

Creates a PHP array with the given input

<?php
array(array $rest)

Examples

Example #1: Associative Array Example

index.tpl
{assign array(name="Bob" gender="male") user}
{$user.name} is {$user.gender}

The above example will output:

Bob is male

Example #2: Auto-indexed Array Examples

index.tpl
{assign array("Bob" "John") users}
First user is : {$users.0}
User list : {foreach $users user}{$user} {/foreach}

The above example will output:

First user is : Bob
User list : Bob John