Re: [SMARTY] Counting number of array elements
| From: | Monte Ohrt | Date: | Thu, 09 Feb 2006 15:16:48 +0000 |
| Subject: | Re: [SMARTY] Counting number of array elements | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-13310@lists.php.net to get a copy of this message | ||
http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions#template-1
Dep wrote:
Hello to all! Is there any straight and obvious way to count the number of elements in some array??? maybe I'm blind, but can't find that in the manual, and the only way out I've found so far is like this. {foreach from=$some_arr item=$i name="my_foreach"}{/foreach} Number of elements: {$smarty.foreach.my_foreach.total} Looks horribly stupid :) So, any other way? Best regards Dmitriy