Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End An Array of Arrays

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #185717
    Matt
    Participant

    Hi Guys,

    I am trying to pull a value out of a response from Amazon AWS.

    It is returning an array of arrays and I am iterating over it using:

    `
    foreach ( $response as $object) {

    }

    `
    If Iprint_r($object) I receive the following:

    `
    Array
    (
    [Key] => File.jpg
    [LastModified] => 2014-09-10T01:41:54.000Z
    [ETag] => “d41d8cd98f00b204e9800998ecf8427e”
    [Size] => 0
    [Owner] => Array
    (
    [ID] => 1774a92
    [DisplayName] => begftp
    )

    [StorageClass] => STANDARD
    

    )
    `

    I am trying to grab the value of [key] but no matter what I try I can’t seem to get it.

    Thanks for any help.

    Matt

    #185720
    __
    Participant

    I am trying to grab the value of [key] but no matter what I try I can’t seem to get it.

    I don’t see any index named “key” in your array. There is an index named “Key“; perhaps that’s what you are looking for?

    #185723
    Matt
    Participant

    Good Lord!!

    Thank you. I’ve been trying everything. Thank you for packing that up.

    For anyone playing at home the I am know using:

    $object['Key']
    <code></code>

    and it works perfectly.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.