print_r in smarty - How to print your array contents in smarty template.

You can print a array contents like in php print_r() function in smarty tempalte. The common mistake is to forget about second print_r parametr for returning it's output. This parameter have to be set to true. If you forget to set it to true, your array contents propably will be somewhere at begining of a content. This is the solution:
{$myArray|@print_r:true}
Notice the @ symbol that provides parsing argument as array, not as string.

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP