我正在使用 jotform php api 来取回我所有的提交。响应写在下面。我想不出一种方法来解析所有数据。如何解析这个复杂的数组?
array(3) {
[0]=>
array(9) {
["id"]=>
string(18) "331530421121325001"
["form_id"]=>
string(14) "53263737388365"
["ip"]=>
string(13) "32.33.33.33"
["created_at"]=>
string(19) "2016-02-17 10:00:07"
["status"]=>
string(6) "ACTIVE"
["new"]=>
string(1) "0"
["flag"]=>
string(1) "0"
["updated_at"]=>
string(19) "2016-02-17 10:00:17"
["answers"]=>
array(1) {
[1]=>
array(4) {
["text"]=>
string(9) "Full Name"
["type"]=>
string(16) "control_fullname"
["answer"]=>
array(2) {
["first"]=>
string(15) "nnnasdadsaasdad"
["last"]=>
string(20) "dsadsadsadsadadassda"
}
["prettyFormat"]=>
string(36) "nnnasdadsaasdad dsadsadsadsadadassda"
}
}
}
}
这是我的代码,但到目前为止还没有那么成功。
$responses=$jotformAPI->getSubmissions();
foreach ($responses as $response) {
//print_r($response);
foreach($response as $element=>$value)
{
echo $value;
if(is_array($value))
{
foreach($value as $val)
{
echo $val;
}
}
}
}
请帮忙。