I have a problem with sessions and arry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GerryG
    New Member
    • May 2014
    • 3

    I have a problem with sessions and arry

    Hi,
    I need your help!

    I have this script
    Code:
    <?php echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>'; ?>
    
    and I see:
    Array
    (
        [Zid] => 1
        [member] => Array
            (
                [id] => 3
                [group_id] => 1
                [first_name] => Pippo
                [last_name] => muse
                [email] => pippo@pippo.com
                [phone] => 001111111
                [website] => www.pippo.com
                
            )
    
    )
    I need to display on the page; Pippo
    the content of the variable $first_name;
    and write:
    echo $member[first_name];
    but doesn't work
    can you help me?
    Thanks
    Gerry
    Last edited by Rabbit; May 11 '14, 07:27 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    rtfm....... ;-)

    But i also did not read them, but did you try:
    Code:
    echo $member['first_name'];

    Comment

    • GerryG
      New Member
      • May 2014
      • 3

      #3
      $member['first_name']
      it doesn't work.
      ...... is empty!

      Comment

      • Luuk
        Recognized Expert Top Contributor
        • Mar 2012
        • 1043

        #4
        hmm, i overlooked an array, because you did not use '[CODE]' tags its a bit ......

        the answer should be:
        Code:
        echo $_SESSION['member']['first_name'];

        Comment

        • GerryG
          New Member
          • May 2014
          • 3

          #5
          Work!
          Thanks........

          Comment

          Working...