Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在AWS-SDK的CakePHP 3视图中打开和回显数组值_Php_Amazon Web Services_Attributes_Amazon Dynamodb_Cakephp 3.x - Fatal编程技术网

如何在AWS-SDK的CakePHP 3视图中打开和回显数组值

如何在AWS-SDK的CakePHP 3视图中打开和回显数组值,php,amazon-web-services,attributes,amazon-dynamodb,cakephp-3.x,Php,Amazon Web Services,Attributes,Amazon Dynamodb,Cakephp 3.x,我使用AWS SDK从AWS DynamoDB获取数据,一切正常,因为我在控制器中获得了数据,我可以调试它 这是我的控制器(没有参数和连接字符串): 以下是调试结果: [ 'Items' => [ (int) 0 => [ 'email' => [ 'S' => 'whatever@gmail.com' ], 'id' => [

我使用AWS SDK从AWS DynamoDB获取数据,一切正常,因为我在控制器中获得了数据,我可以调试它

这是我的控制器(没有参数和连接字符串):

以下是调试结果:

[
    'Items' => [
        (int) 0 => [
            'email' => [
                'S' => 'whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI833053'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 1 => [
            'email' => [
                'S' => 'whatever@saunalahti.fi'
            ],
            'id' => [
                'S' => 'FI817755'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 2 => [
            'email' => [
                'S' => 'whateverm@gmail.com'
            ],
            'id' => [
                'S' => 'FI584457'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 3 => [
            'email' => [
                'S' => 'whatever@hotmail.com'
            ],
            'id' => [
                'S' => 'FI983129'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 4 => [
            'email' => [
                'S' => 'whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI156537'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 5 => [
            'email' => [
                'S' => 'whatever@lwhatever.fi'
            ],
            'id' => [
                'S' => 'FI626525'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 6 => [
            'email' => [
                'S' => 'whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI085033'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 7 => [
            'email' => [
                'S' => 'whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI099638'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 8 => [
            'email' => [
                'S' => 'vwhatever@hotmail.com'
            ],
            'id' => [
                'S' => 'FI543841'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 9 => [
            'email' => [
                'S' => 'j.whatever@hotmail.com'
            ],
            'id' => [
                'S' => 'FI155684'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 10 => [
            'email' => [
                'S' => 'whatever.whatever.whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI056429'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 11 => [
            'email' => [
                'S' => 'whatever.whatever@gmail.com'
            ],
            'id' => [
                'S' => 'FI010893'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 12 => [
            'email' => [
                'S' => 'whatever@kolumbus.fi'
            ],
            'id' => [
                'S' => 'FI344380'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ],
        (int) 13 => [
            'email' => [
                'S' => 'whatever@hotmail.com'
            ],
            'id' => [
                'S' => 'FI024009'
            ],
            'driver' => [
                'M' => [
                    'city' => [
                        'S' => 'Vantaa'
                    ]
                ]
            ]
        ]
    ],
    'Count' => (int) 14,
    'ScannedCount' => (int) 84,
    '@metadata' => [
        'statusCode' => (int) 200,
        'effectiveUri' => 'https://dynamodb.eu-west-1.amazonaws.com',
        'headers' => [
            'server' => 'Server',
            'date' => 'Sun, 09 Sep 2018 10:45:05 GMT',
            'content-type' => 'application/x-amz-json-1.0',
            'content-length' => '1491',
            'connection' => 'keep-alive',
            'x-amzn-requestid' => '6CJS11E3S5RK2CKI7L6DM0QBURVV4KQNSO5AEMVJF66Q9ASUAAJG',
            'x-amz-crc32' => '219838078'
        ],
        'transferStats' => [
            'http' => [
                (int) 0 => []
            ]
        ]
    ]
]
我无法响应结果集,我尝试了所有这些,但没有成功:

foreach ($result['Items'] as $i) {
//$prod_drivers = $marshaler->unmarshalItem($i);

//echo implode($i);

//echo $i['email'];
//echo $i->email;

//    echo $prod_drivers['email']."<br/>";
}
foreach($result['Items']作为$i){
//$prod_drivers=$marshaler->unmarshalItem($i);
//回声内爆($i);
//echo$i['email'];
//echo$i->email;
//echo$prod_驱动程序['email']。“
”; }
如何在html中打开echo数组


谢谢,

我自己通过对数组的一些研究找到了答案,必须考虑字符串作为变量类型:

<php foreach ($result['Items'] as $row) { ?>

      <tr>
        <td>John</td>
        <td>Doe</td>
        <td><?php echo $row['email']['S']?></td>
      </tr>
<?php

}?>

约翰
雌鹿
<php foreach ($result['Items'] as $row) { ?>

      <tr>
        <td>John</td>
        <td>Doe</td>
        <td><?php echo $row['email']['S']?></td>
      </tr>
<?php

}?>