print session variable

5 replies
I need a little help with how to print this session variable to screen

the password field is the one im trying to echo out.

Array (
Object (
[path] =>
Array (
[0] =>
Array (
[post] =>
Array (
[password] => 123456
)
)
)
)
)
#print #session #variable
  • Is there a particular piece of software you are using or is it custom coded?

    From the code you posted, the password is in an object. You'll need to look through the code to see where the object was instantiated... something like:


    PHP Code:
    myObject = new ObjectName(); 

    Then to view the variables (object properties) you can use syntax like:

    PHP Code:
    echo $ myObject->password
    Depending on the way it's coded, it may not be that simple. But that's the basic paradigm for printing out object properties for troubleshooting. Personally, I use PHPed. It's usually easier to track down bugs that way.

    HTH
    {{ DiscussionBoard.errors[3370933].message }}
    • Profile picture of the author tirupati
      I think this syntax will work
      echo $ myObject->password;
      If it is wrong let me know
      {{ DiscussionBoard.errors[3372086].message }}
      • Profile picture of the author Tim Brownlaw
        It's an array of a multidimensional array object...(try typing that out quickly)

        Once you get the object out of the array...
        PHP Code:
        echo $ myObject->path[0]['post']['password']; 
        I have to ask... what is generating this?
        {{ DiscussionBoard.errors[3372755].message }}
  • Profile picture of the author nxtgencreative
    clean output in the screen:

    <pre>
    <?php print_r($myobject->password); ?>
    </pre>
    {{ DiscussionBoard.errors[3373901].message }}
  • Profile picture of the author voitenkos
    or you can use var_dump($myobject->password) as well
    {{ DiscussionBoard.errors[3556215].message }}

Trending Topics