access array element

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • theoni
    New Member
    • Feb 2008
    • 20

    #1

    access array element

    hello i have a stupid question i need help with in the array [code=text]
    Array ( [SESSION] => object Object ( [session_test] => 5FZ0bc4ion [page_category] => courses [bullet_category] => [logincount] => 0 ) [USER] => stdClass Object ( [id] => 82 [auth] => email [confirmed] => 1 [policyagreed] => 1 [deleted] => 0 [gender] => f [username] => theoni [password] => 8d76acf438cccac dca337f652825f9 96 [paypal] => [idnumber] => [firstname] => fenia [lastname] => #$% [email] => __munged__ [emailstop] => 0 [dateofbirth] => 0 [degree] => [expertise] [/code]

    I need to echo the $SESSION[USER] but i don't know how. can you please help?
    thank you
    Last edited by pbmods; Jul 3 '08, 01:52 AM. Reason: Added CODE tags, removed email.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Theoni.

    Which property of the User object do you want to output?

    You'll need to do something like this (assuming what you put in your OP is a print_r() of $_SESSION):
    [code=php]
    echo $_SESSION['USER']->id;
    [/code]

    Comment

    • theoni
      New Member
      • Feb 2008
      • 20

      #3
      Originally posted by pbmods
      Heya, Theoni.

      Which property of the User object do you want to output?

      You'll need to do something like this (assuming what you put in your OP is a print_r() of $_SESSION):
      [code=php]
      echo $_SESSION['USER']->id;
      [/code]

      Thank you very much pbmods, this does work!

      kind regards

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        We aim to please.

        Good luck with your project, and if you ever need anything, post back any time!

        Comment

        Working...