I want to produce an array result like this [‘element1′,’element2′,’element3’] with smarty. I am working with PHP and smarty. The array is generated from PHP and then outputted by smarty in the above format or style.
My PHP code is like this:
$countries = array('America','Germany','Japan');
I want to display the same array content in Smarty but this time the result should be displayed as this in smarty
['America','Germany', 'Japan']
Could anyone be of help to me? Thanks!
Check foreach loop here
PHP CODE
SMARTY CODE