example:
$_SESSION['10'] = 'testing';
echo $_SESSION['10'];
The above will not print out anything...i found out(after a long time of frustration) that you cannot use a string numeral as a index for the $_SESSION variable. Anyone know why?
example:
$_SESSION['10'] = 'testing';
echo $_SESSION['10'];
The above will not print out anything...i found out(after a long time of frustration) that you cannot use a string numeral as a index for the $_SESSION variable. Anyone know why?
Quote from here:
The PHP session storage mechanism was originally built around "registering" variables, so the keys in
$_SESSIONmust be names that could be treated as variables in their own right. This means that$_SESSION[10]is invalid, because$10wouldn't be a valid variable name, and since$foo[10]and$foo['10']refer to the same thing,$_SESSION['10']is invalid as well.