I'm working with a NuSOAP client to bring back data from a web service. The array I get back looks like this (shortened for readability):
[count] => 1
[data] => Array
 => Array
[accountCreatedDate] => 2014-03-04T23:49:39.459Z
[accountDefinedValues] => Array
 => Array
[dataType] => 0
[displayType] => 2
[fieldName] => Attributes
[fieldRef] => 24281.0.2664
[value] => Sample Attribute
[valueRef] => 24281.0.5668899
I currently have the following set up to look for values in the Attributes array so I can add them all to one field in MySQL as a comma-separated list:
foreach ($data['accountDefinedValues'] as $arr)
if ($arr['fieldName'] != 'Attributes') continue;
$qry->attributes = $qry->attributes.$arr['value'].", ";
The problem I'm having is that the $qry->attributes variable is only capturing one of the values. There could be 20 different Attributes that are brought back under the accountDefinedValues array.
How do I loop through or concat all of them into the $qry->attribues field as a comma-separated list?
Help is much appreciated.