Foreach - get the line number

From: Date: Wed, 02 Jul 2003 14:39:12 +0000
Subject: Foreach - get the line number
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9808@lists.php.net to get a copy of this message
I'm using foreach to go throuh a big array. But i want to show the number of the line. {foreach from=$lesfiches item=fiche} $i - <a href="ct_faq.php?id={$fiche.id}">{$fiche.titre}</a><br> {/foreach} Replace $i by the number of the line, ie : 1- <a href="ct_faq.php?id=51">Title</a><br> 2- <a href="ct_faq.php?id=31">Title</a><br> 3- <a href="ct_faq.php?id=47">Title</a><br> I haven't seen how to do this in the doc. Can u help me ? Thx a lot :) Olivier Doucet www.ajeux.com

« previous php.smarty.general (#9808) next »