For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] Variable type in smarty?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Variable type in smarty?
Robert Amos

2004-08-26, 8:58 pm

you can use almost any simple php expression inside an {if} statement.

So:

{if is_int($var)}
do stuff
{/if}

will work fine.

-bok

On Thu, 26 Aug 2004 17:16:35 -0400, John Nichel <john@kegworks.com> wrote:
> I've looked all thru the manual and can't find any type of function to
> determine if a variable is an integer in smarty. Is this possible?
>=20
> --
> John C. Nichel
> =DCberG
> KegWorks.com
> 716.856.9675
> john@kegworks.com
>=20
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>

John Nichel

2004-08-30, 3:59 pm

Robert Amos wrote:
> you can use almost any simple php expression inside an {if} statement.
>
> So:
>
> {if is_int($var)}
> do stuff
> {/if}
>
> will work fine.
>
> -bok


Thanks Robert...just what I need.

--
John C. Nichel
ÜberG
KegWorks.com
716.856.9675
john@kegworks.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com