|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
sandeepshinde Smarty Rookie
Joined: 07 Jul 2004 Posts: 13
|
Posted: Fri Aug 06, 2004 10:01 am Post subject: Problem in arrays |
|
|
I am using arrays in smarty
when i want to show the number of elements in an array
i use {$arr|@count}
i shows me the correct count but when the array is empty it shows me
1 count always.
can anybody tell me y is so? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Aug 06, 2004 2:12 pm Post subject: |
|
|
when the array is empty it shows you 0.
when the array is not an array, but an empty string for example, it shows you 1.
see: http://php.net/count
If var is not an array, 1 will be returned (exception: count(NULL) equals 0). |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|