<?php
for($i = 1;$i < 9; $i++)
{
$tempStr = "<tr><td><label>上传第{$i}个文件: </label> <input type='file' name='uploadfile_{$i}'</label></td></tr>;
echo($tempStr);
}
?>
for($i = 1;$i < 9; $i++)
{
$tempStr = "<tr><td><label>上传第{$i}个文件: </label> <input type='file' name='uploadfile_{$i}'</label></td></tr>;
echo($tempStr);
}
?>
php5
firefox3在tr标签中加入td标签就可以分行显示了
<tr>
<td>
<label> 上传第 <?php echo $i;?>个文件: </label> <input type="file" name="uploadfile_ <?php echo $i;?>">
</td>
</tr>
for ($i=1;$i <9;$i++)
{
?>
<tr> <td>
<label> 上传第 <?php echo $i;?>个文件: </label> <input type="file" name="uploadfile_ <?php echo $i;?>">
</td> </tr>
<?php
}
?>
for ($i=1;$i <9;$i++)
{
?>
<tr> <td>
<label> 上传第 <?php echo $i;?>个文件: </label> <input type="file" name="uploadfile[]">
</td> </tr>
<?php
}
?>