Phalanxer Posted June 29, 2012 Share Posted June 29, 2012 I really don't quite understand this problem: Cannot unset string offsets if (isset($_SESSION['tablea']['numbers1-6'])) { $_SESSION['tablea']['numbers1-6prior'] = $_SESSION['tablea']['numbers1-6']; unset($_SESSION['tablea']['numbers1-6']); } The problem is with the last line - unset($_SESSION['tablea']['numbers1-6']); Can someone please tell me what the problem is? I don't understand. Quote Link to comment https://forums.phpfreaks.com/topic/264988-cant-unset-string-offsets/ Share on other sites More sharing options...
memfiss Posted June 29, 2012 Share Posted June 29, 2012 in this part no problems $_SESSION['tablea']['numbers1-6'] = 1; if (isset($_SESSION['tablea']['numbers1-6'])) { $_SESSION['tablea']['numbers1-6prior'] = $_SESSION['tablea']['numbers1-6']; unset($_SESSION['tablea']['numbers1-6']); } var_dump($_SESSION['tablea']['numbers1-6']); Notice: Undefined index: numbers1-6 in /var/www/absolux/test/run.php on line 8 NULL Quote Link to comment https://forums.phpfreaks.com/topic/264988-cant-unset-string-offsets/#findComment-1357935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.