This article describes how to use the smarty template to determine whether an array is empty. The example analyzes two methods for judging an empty array by using the smarty template, which is very simple and practical. For more information, see
This article describes how to use the smarty template to determine whether an array is empty. The example analyzes two methods for judging an empty array by using the smarty template, which is very simple and practical. For more information, see
This example describes how to use the smarty template to determine whether an array is null. Share it with you for your reference. The details are as follows:
Here we mainly introduce two methods:
1. Use count to obtain the number of subscripts of the array
In the following example, if $ array is null, no data is 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 help you design php programs based on the smarty template.