Re: how the get the length of array from smarty
"messju mohr" <[email protected]> Thu, 29 Sep 2005 17:22:53 +0200
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <20050929152253.GB11527@dune> |
On Thu, Sep 29, 2005 at 03:51:35PM +0200, Arpad Borsos wrote:
> Or simply check if the array is empty
> {if empty($var)}
Or simply check if the var is true (empty arrays aren't, arrays with
at least one element are).
{if $var} ... {/if}
> James Mao schrieb:
>
> >hi,
> >
> >i have an array in the template file $users, how can i determin the
> >length of this array, so that if the length is zero i can output some
> >desc strings.
> >And another question is how can i determine if the variable is NULL?
> >
> >Thanks,
> >James
> >
>
> --
> ________________________________
> MfG Arpad Borsos aka "Swatinem"
> http://localhost.renegade-planet.de
> ________________________________
> Reclaim Your Inbox! - Mozilla Thunderbird
> http://www.mozilla.org/products/thunderbird/
>
> Take Back the Web! - Mozilla Firefox
> http://www.mozilla.org/products/firefox/
> ________________________________
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php