RE: [PHP] Parse String to Integer?

From: Date: Tue, 12 Sep 2000 14:52:16 +0000
Subject: RE: [PHP] Parse String to Integer?
Groups: php.general 
Request: Send a blank email to php-general+get-16363@lists.php.net to get a copy of this message
Did you try: $sum = $first + $sec; echo $sum; This should print 5! PHP is not strong typed, so if you use a string variable that consists only of numbers in an addition, it will be read as a number. Cheers Marc > -----Original Message----- > From: Santhyago Bueno Gallao [SMTP:san@onset.com.br] > Sent: Tuesday, September 12, 2000 3:49 PM > To: PHP General Questions > Subject: [PHP] Parse String to Integer? > > How i do to convert string to integer(number)? > > $first = "3"; > $sec = 2; > > $sum = $sec + $function($first); > > What is the "$function()"? > > > Tks, > > Santhyago > << File: ATT11027.txt >>

« previous php.general (#16363) next »