Skip to the content
Documentation

How to append to a variable array ?

No ratings yet

hello,
Assuming I have a variable $A=array(1,2,3)
and In a loop I need to append $article.node_id to this array ?
how would i do that ?
The only possible way is that i have to retype the array and append after it? and it didn't wok any where else
please contact
thanks

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Re: How to append to a variable array ?

    Marc Boon ·

    {set $A=$A|append($article.node_id)}