flit Posted April 13, 2008 Share Posted April 13, 2008 Hi there, Can anyone help me delete a comma from a session My session file looks like this id|s:8:"1,2,3,"; I know how to delete a variable from a session [unset($_SESSION['2']);], but I cannot delete the last comma from the session. I would like the session file to look like this: id|s:8:"1,2,3"; instead of id|s:8:"1,2,3,"; Link to comment https://forums.phpfreaks.com/topic/100945-how-do-i-delete-a-comma-from-a-sesseion/ Share on other sites More sharing options...
papaface Posted April 13, 2008 Share Posted April 13, 2008 $_SESSION['2'] = rtrim($_SESSION['2'],","); Link to comment https://forums.phpfreaks.com/topic/100945-how-do-i-delete-a-comma-from-a-sesseion/#findComment-516207 Share on other sites More sharing options...
flit Posted April 13, 2008 Author Share Posted April 13, 2008 Thanks dude! Link to comment https://forums.phpfreaks.com/topic/100945-how-do-i-delete-a-comma-from-a-sesseion/#findComment-516246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.