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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.