是否可以创建包含相关字段的多维$ _POST数组? (CompanyName,CompanyAddress,CompanyPhone)(HomePhone,HomeAddress,HomeState)我想要做的是当我点击提交时,我基本上在$ _POST数组中有两个数组,如下所示:
$_POST['CompanyInfo']['CompanyName']
$_POST['CompanyInfo']['CompanyAddress']
$_POST['CompanyInfo']['CompanyPhone']
$_POST['HomeInfo']['HomePhone']
$_POST['HomeInfo']['HomeState']
$_POST['HomeInfo']['HomeAddress']
答案 0 :(得分:0)
正确设置表单的输入名称将允许您完成此操作。
可以使用<input name="CompanyInfo[CompanyName]" type="text" />
$_POST['CompanyInfo']['CompanyName']