note 81171 added to function.explode

From: Date: Sat, 16 Feb 2008 19:59:08 +0000
Subject: note 81171 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-136209@lists.php.net to get a copy of this message
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']); } ---- Server IP: 209.41.74.194 Probable Submitter: 216.231.32.190 ---- Manual Page -- http://www.php.net/manual/en/function.explode.php Edit -- https://master.php.net/note/edit/81171 Del: integrated -- https://master.php.net/note/delete/81171/integrated Del: useless -- https://master.php.net/note/delete/81171/useless Del: bad code -- https://master.php.net/note/delete/81171/bad+code Del: spam -- https://master.php.net/note/delete/81171/spam Del: non-english -- https://master.php.net/note/delete/81171/non-english Del: in docs -- https://master.php.net/note/delete/81171/in+docs Del: other reasons-- https://master.php.net/note/delete/81171 Reject -- https://master.php.net/note/reject/81171 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136209) next »