php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #6446 Session Array Variable Append
Submitted: 2000-08-30 15:12 UTC Modified: 2002-01-28 20:08 UTC
From: nathan at cjhunter dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.1pl2 OS: Linux 2.0.36
Private report: No CVE-ID: None
 [2000-08-30 15:12 UTC] nathan at cjhunter dot com
When using php sessions with a registered array variable; if that variable is set before the call to session_start() is made, instead of overwriting the variable with the stored session value I request php check if that variable is already set and do an array_merge() on the two arrays. This is useful for accumulating key and value pairs.

Example

first..

<? 
$input = array();
session_register("input");
?>

then..

<?

// Upon form submission at session_start() the input variable is overwritten
session_start();

var_dump($input);

?>

<form>
<input type="text" name="input[<?echo time()?>]">
<input type="submit">
</form>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 20:08 UTC] yohgaki@php.net
Won't change....
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 21:01:30 2025 UTC