$_SESSION in PHP
I'm trying to achieve something like $_SESSION[$key] 开发者_StackOverflowwithout the need of foreach loop, how can I achieve this? Please let me know
Thanks
array_merge will do more or less what you want assuming id is never numeric and you want to put everything in $_POST
into $_SESSION
, which may not be a good idea
$_SESSION=array_merge($_SESSION,$_POST);
the problem is sorted, I had to include single quotes in $_SESSION's index in order to make it treat like a non-numeric index.
Thanks for the help guys!
精彩评论