Jump to content

Help getting variable from array


tqla

Recommended Posts

Hello. Can someone show the syntax to echo the variable from the array below that is showing "2010-08-31 23:19"? I need to grab that date and use it elsewhere in my script. Thanks.

 


array(19) {
  ["name"]=>
  string( "com_jumi"
  ["params"]=>
  array(0) {
  }
  ["mainframe"]=>
  &object(JSite)#2 (6) {
    ["_clientId"]=>
    int(0)
    ["_messageQueue"]=>
    array(0) {
    }
    ["_name"]=>
    string(4) "site"
    ["scope"]=>
    string( "com_jumi"
    ["_errors"]=>
    array(0) {
    }
    ["requestTime"]=>
    string(16) "2010-08-31 23:19"
  }

Link to comment
Share on other sites

So in this case (below) what is the $arrayName? I've tried com_jumi but it did not work. I know how to get array elements but this has me beat.

 

Array
(
    [name] => com_jumi
    [params] => Array
        (
        )

    [mainframe] => JSite Object
        (
            [_clientId] => 0
            [_messageQueue] => Array
                (
                )

            [_name] => site
            [scope] => com_jumi
            [_errors] => Array
                (
                )

            [requestTime] => 2010-09-01 00:39
        )

Link to comment
Share on other sites

So in this case (below) what is the $arrayName? I've tried com_jumi but it did not work. I know how to get array elements but this has me beat.

 

Array
(
    [name] => com_jumi
    [params] => Array
        (
        )

    [mainframe] => JSite Object
        (
            [_clientId] => 0
            [_messageQueue] => Array
                (
                )

            [_name] => site
            [scope] => com_jumi
            [_errors] => Array
                (
                )

            [requestTime] => 2010-09-01 00:39
        )

 

The only way to get the output you posted is by doing var_dump($something);  so whatever $something is, is what $array is in my example.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.