I am using jotform php api to get all my submitions back.The response is written bellow. I cannot figure a way to parse all the data. How can I parse this complex array?
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"
}
}
}
}
here is my code but is not that successfull so far.
$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;
}
}
}
}
please help.
I solved using a recursive function