count element of array ?
| From: | adwinwijaya | Date: | Thu, 08 Apr 2004 00:48:58 +0000 |
| Subject: | count element of array ? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11247@lists.php.net to get a copy of this message | ||
Hello smarty-general,
Is there any function to count the number of element in an array
that passed to smarty ?
I need that to formating the string ...
for example I have an array contain {'a','b','c','d'}
and I want to print it as a,b,c,d (with ',') but after d .. it
doesnt need to add ',' ..
and for foreach(), how to get the current index ?
forexample:
{foreach from=$custid item=curr_id}
id: {$curr_id}<br>
{/foreach}
I want to display it as:
1. curr_id
2. curr_id
3. curr_id ...etc etc ?
--
Best regards,
adwin