Session Array Problem ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PatelNehal
Forum Newbie
Posts: 21
Joined: Mon Mar 23, 2009 7:27 am
Location: Gujarat, India

Session Array Problem ??

Post by PatelNehal »

$_SESSION['domains'] array :

Code: Select all

 
Array
(
    [myname1.co.in] => Array
        (
            [status] => available
            [classkey] => thirdleveldotin
            [Price] => 411.76
            [Currency] => INR
            [timeperiod] => 1
        )
 
    [myname2.com] => Array
        (
            [status] => available
            [classkey] => dotin
            [Price] => 751.26
            [Currency] => INR
            [timeperiod] => 1
        )
)
 
now i want to delete the second record for from the session array how to do it...???
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Session Array Problem ??

Post by jackpf »

Code: Select all

unset($_SESSION['myname2.com']);
User avatar
PatelNehal
Forum Newbie
Posts: 21
Joined: Mon Mar 23, 2009 7:27 am
Location: Gujarat, India

Re: Session Array Problem ??

Post by PatelNehal »

Thank you Mr. jackpf but its not working....!!!!
I am storing an array in session which name is domains and its also contain arrays
$_SESSIONI['domains']

Code: Select all

[domains] => Array
 (
    [myname1.co.in] => Array
         (
             [status] => available
             [classkey] => thirdleveldotin
             [Price] => 411.76
             [Currency] => INR
             [timeperiod] => 1
         )
       [myname2.com] => Array
         (
             [status] => available
             [classkey] => dotin
             [Price] => 751.26
             [Currency] => INR
             [timeperiod] => 1
         )
 )
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Session Array Problem ??

Post by requinix »

Okay... so...

Code: Select all

unset($_SESSION['domains']['myname2.com']);
How do you expect to develop with PHP if you don't know the language?
User avatar
PatelNehal
Forum Newbie
Posts: 21
Joined: Mon Mar 23, 2009 7:27 am
Location: Gujarat, India

Re: Session Array Problem ??

Post by PatelNehal »

ya its working now thanks a lot. :lol:
Post Reply