我正在使用Yodlee API来获取登录表单特定的bank.i得到o / p作为json response.i想将其转换为html form.pls帮助。
这是我的输出: ' {" conjunctionOp" {" conjuctionOp":1}," componentList":[{" valueIdentifier":&#34 ; LOGIN"" valueMask":" LOGIN_FIELD""字段类型" {"的typeName":" IF_LOGIN&#34 ;}"大小":20,"最大长度":30," fieldInfoType":" com.yodlee.common.FieldInfoSingle",& #34;名称":"登录"," displayName":"用户名"," isEditable":true,&#34 ; isOptional":假," isEscaped":假,"帮助文件":" 21884"" isOptionalMFA":假,&# 34; isMFA":假},{" valueIdentifier":" PASSWORD"" valueMask":" LOGIN_FIELD"&#34 ;字段类型" {"的typeName":" IF_PASSWORD"}"大小":20,"最大长度":40,&# 34; fieldInfoType":" com。' ...(长度= 723)
I parse the json data:$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
//print_r($result);
$myArray = json_decode($result, true);
//print_r($myArray);
foreach($myArray as $users){
foreach($users as $user){
// echo $x=$user['valueIdentifier'][0];
// echo $x=$user['credentialFields[0].valueIdentifier'];
echo $user['valueIdentifier'];
// echo $user['valueIdentifier'];
}
}
答案 0 :(得分:0)
您可以参考已经通过stackoverflow回答的不同问题。
如果您正在寻找这样做的过程,那么您需要解析JSON响应,然后提取必需的字段,然后创建自己的HTML页面,其中包含HTML表单。
对于解析,您可以参考此link