Hello, SP folks!
I am extracting a number form db. After accessing the value, I want to set it to a var.
But the catch here is that this var only accepts int type. If I assign an int as below:
PHP Code:
$somevar = 2009;
This turns out to be OK.
But when I assign the number (not int) extracted from db, as follows, it does not work:
PHP Code:
$somevar = $table['somefield'];
I tried using following methods to have $somevar converted to int type, but there were no promising results:
PHP Code:
//1
$somevar = (int)$table['somefield'];
//2
$somevar = intval($table['somefield']);
//2a - arg 2 is optional
$somevar = intval($table['somefield'],10);
$somevar's supposed to contain expiration time for cookie, if it helps helping my out.
Thanks SitePointers!
Bookmarks