我设计了一个表单并将其提交给PHP进行处理。我在此表格表格中放置了几个“输入”,需要将它们传递给数组。 “输入不固定”,可以是10或20或更多,可以添加或删除。我的问题是:我不知道如何将此“值”传递给php变量,该变量在另一个多维数组中 html:
1 <input type="text" name="description[]" id="1">
2 <input type="text" name="description[]" id="2">
3 <input type="text" name="description[]" id="3">.....
15 <input type="text" name="description[]" id="15">
php:
$detail = array ('aa' => 'non','bb' => array('0' => array('Description'=>$_POST['description'][0],'DD'=>'CN'),'1'=>array('Description'=>$_POST['description'][1],'DD'=>'CN')...
答案 0 :(得分:0)
据我所知,您所需要的是将其推送到具有值的现有数组中:
WITH composition AS (
UPDATE prd.composition c SET ( -- See here
explode
) = (
payload_composition.explode
)
FROM json_to_record($1) AS payload_composition (
id integer,
explode boolean
)
WHERE id IS NOT NULL
RETURNING c.* -- and here
)