SRL Archive - Web Development

String to integer?


XcanadamanX

2007-08-23 15:09:17

is there a string to integer function in PHP?
ive looked on PHP.net but couldnt find any. help plz.

Sumilion

2007-08-23 16:56:23

[php]$a = '19';
$b = '35';
$result = ( ((int) $a) + ((int) $b) );[/php]

There we go :) (from a site)

XcanadamanX

2007-08-23 19:32:02

thanks sum!

Markus

2007-08-25 13:51:23

In PHP all variables are variants, so String to Int doesn't exist, every variable is every type ;)

XcanadamanX

2007-08-25 16:36:37

really…:stirthepot:

Night

2007-08-28 00:24:21

yep, no need to cast =/