我需要将一些用户详细信息从PHP脚本传递给Grails。用户详细信息包含在一个数组数组中。在Groovy中,我可以获得数组元素def user = params.userName
。但是如何从数组数组中获取元素,或者如果我得到整个数组也会有用吗?
从PHP我传递这样的数组:
$userDetails = array ('currencyId' => 1,
'contact' => array (
'city' => $city,
'countryCode' => $country,
'stateProvince' => $state,
'email' => $email),
'userName' => $loginName,
'password' => $pwd
);
$field_string = http_build_query($userDetails);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $field_string);