R: [PHP] how to unregister session stored as multidimensional array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try

<?
@reset( $_SESSION['client'] );
while ( list( $var, $val ) = @each( $_SESSION['client'] ) ) {
	if ( $var != 'name' ) unset( $_SESSION['client'][ $val ] );
} 
?>

a bit dirty but works... :-/


Sebastian Konstanty Zdrojewski 

________________________________

URL: http://www.en3py.net/
E-Mail: en3py@xxxxxxxx

________________________________

Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-----Messaggio originale-----
Da: afan@xxxxxxxx [mailto:afan@xxxxxxxx] 
Inviato: lunedì 5 dicembre 2005 21.46
A: PHP eMail List
Oggetto:  how to unregister session stored as multidimensional array?

Is this possible at all:
I have stored info from form in session:
$_SESSION['client']['name'] = 'Name'
$_SESSION['client']['address'] = 'Address'
$_SESSION['client']['city'] = 'City'
$_SESSION['client']['state'] = 'State'
$_SESSION['client']['zip'] = 'Zip

Now, I want to unregister all $_SESSION['client'] info EXCEPT
$_SESSION['client']['name'].

With
session_unregister('client');
I clear everything.

session_unregister('address');
doesn't clear this session.

session_unregister($_SESSION['client']['address']);
doesn't work.

What am I doing wrong?

Thanks for any help.

-afan

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 02/12/2005
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux