note 81171 rejected from function.explode by ezyang

From: Date: Sat, 16 Feb 2008 21:00:23 +0000
Subject: note 81171 rejected from function.explode by ezyang
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-136210@lists.php.net to get a copy of this message
Note Submitter: ghepting at neteffexstudios dot com ---- Anyone have an idea why using the explode() function and using a $_SESSION['variable'] as the string to turn into an array would leave the original $_SESSION['variable'] as an array itself? This doesn't happen with non session variables... I've tested it both ways and it behaves quite differently. here is a code example I ran into this with: // Split the date of birth into year, month, & day $dob = explode('-',$_SESSION['dob']); // THIS MESSES UP THE SESSION VARIABLE... // So I'm imploding it back after I'm done with the $dob array if( is_array($_SESSION['dob']) ) { $dob = implode('-',$_SESSION['dob']); }

« previous php.notes (#136210) next »