Originally posted by relytjj
$_SESSION['size'][$_POST['pid'].$_POST['select_size0']] = $_POST['pid']."|".$_POST['select_size0']."|".$valu
e;
[/b]
This seems unnecessarily complicated. If you're using the pid and select_size0 as array keys, then why store them in the value as well? Also, if you're using pid and select_size0 as array keys, why not use them as separate array keys, rather than joining them together to make one?
$_SESSION['size'][ $_POST['pid']][ $_POST['select_size0']] = $value;
Contains all of the same information, and more accessibly (since you don't need to mess around with breaking strings up). It's also simpler and less prone to typos.
I would also note that even if the $SESSION['size'] array is getting values, only the last $value would be stored: whatever values are already there would get overwritten every time the loop iterates. Perhaps you want
$_SESSION['size'][$_POST['pid'].$_POST['select_size0']][] = $_POST['pid']."|".$_POST['select_size0']."|".$valu
e;
(Or
$_SESSION['size'][ $_POST['pid']][ $_POST['select_size0']][] = $value;
)?
All this of course assumes that $POST['pid'] and $POST['same_size0'] have their proper values.