Php 如何获取包含不同类型变量的数组?
我已尝试为发送简历创建动态表单。我已经创建了带有输入字段的html表。这是我的html代码表单:Php 如何获取包含不同类型变量的数组?,php,arrays,attachment,Php,Arrays,Attachment,我已尝试为发送简历创建动态表单。我已经创建了带有输入字段的html表。这是我的html代码表单: <form action="index.php" method="post" enctype='multipart/form-data' > <table class="table table-bordered table-condensed"> <thead>
<form action="index.php" method="post" enctype='multipart/form-data' >
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Qualification</th>
<th>Year of end</th>
<th>Form</th>
<th>Document</th>
</tr>
</thead>
<tbody class="EducationPlaces">
<tr>
<td>
<input name='edrow[]' type='text' class='form-control' />
</td>
<td>
<input name='edrow[]' type='text' class='form-control' />
</td>
<td>
<input name='edrow[]' type='text' class='form-control' />
</td>
<td>
<input name='edrow[]' type='text' class='form-control' />
</td>
<td>
<input name='edrow[]' type='file' class='form-control' />
</td>
</tr>
</tbody>
</table>
<input type="submit" value="Save" name="save_file">
<br>
</form>
<button class="btn btn-primary" onclick="addEducationRow()"> Add row </button>
最终会有两个不同的数组,我不知道如何得到一个数组,其中包含表中的所有数据
你能告诉我解决问题的正确方法吗 $\u文件用于文件$_POST用于$\u POST数据。。只要这样做,
$dataArray=array($\u文件,$\u POST)代码>…最好不要将文件上传与常规数据放在同一格式中。为文件上载创建单独的页面。
<script type="text/javascript">
function addEducationRow()
{
$("<tr> " +
"<td>" +
"<input name='edrow[]' type='text' class='form-control' />" +
"</td> " +
"<td>" +
"<input name='edrow[]' type='text' class='form-control' />" +
"</td> " +
"</td> " +
"<td>" +
"<input name='edrow[]' type='text' class='form-control' />" +
"</td> " +
"</td> " +
"<td>" +
"<input name='edrow[]' type='text' class='form-control' />" +
"</td> " +
"<td>" +
"<input name='edrow[]' type='file' class='form-control' />" +
"</td> " +
"</tr>").appendTo('.EducationPlaces');
}
</script>
$file_aray=$_FILES['file'];