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. 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 Link to comment https://forums.phpfreaks.com/topic/264988-cant-unset-string-offsets/#findComment-1357935 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.