PDA

View Full Version : Make a number into Integer


AnDy_LiN
12-26-2001, 03:11 PM
I know in other programming languages, it's Int($Variable) but what's the command in PHP?? Thanks

JamesUS
12-26-2001, 03:26 PM
intval($x);

Mark Hensler
12-26-2001, 08:40 PM
PHP Docs: Type Juggling (http://www.php.net/manual/en/language.types.type-juggling.php)

AnDy_LiN
12-27-2001, 05:04 AM
Thanks, really appreciate it :) Here's another question for you 1337 PHP Coders ;)

For random numbers do I still just put Rnd($Val); ??

Mark Hensler
12-27-2001, 04:16 PM
almost...

function definitions for rand() (http://www.php.net/manual/en/function.rand.php):
int rand (void)
int rand (int min, int max)

PHP Docs: srand() (http://www.php.net/manual/en/function.srand.php), mt_rand() (http://www.php.net/manual/en/function.mt-rand.php), mt_srand() (http://www.php.net/manual/en/function.mt-srand.php)