Home > Article > Backend Development > Problem defining data variables in smarty
How to define an array in smarty? After referring to smarty's official website documentation, I found that the following method can be used:
Then var_dump, {$foo|var_dump}, and the array can be printed successfully.
However, please note that this syntax does not exist in smarty2. The variable assigned by the above assignment will become a string. Special attention should be paid to this point
Copyright statement: This article is an original article by the blogger, No reproduction is allowed without the permission of the blogger.
The above introduces the problem of defining data variables in smarty, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.