Re: FW: [PHP] Force variables to add

From: Date: Mon, 08 Jan 2001 19:51:32 +0000
Subject: Re: FW: [PHP] Force variables to add
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33299@lists.php.net to get a copy of this message
Brandon Orther wrote: > By the way I found a way to make strings into integers: > > settype($var, "integer"); > > I did that to my variables and it werked thanx This should work as well: $var1 = "2"; $var2 = "3"; $var3 = (integer) $var1 + (integer) $var2; This way of type-casting is a little easier and non-permanent. regards Wagner -- One maniac alone can do what 20 together cannot

« previous php.general (#33299) next »