The example in this article describes the method of smarty template to judge that the array is empty. Share it with everyone for your reference. The details are as follows:
Here are two main methods:
1. Use count to get the number of subscripts in the array
In the following example, if $array is empty, no data will be output
{if $array|@count neq 0 } // array is empty {/if}
2. Direct judgment
{ if $array neq ""} //array is empty {/if}
I hope this article will be helpful to everyone’s PHP programming based on smarty templates.