如何通过php中的foreach获取多个文本框值

时间:2015-12-16 11:20:54

标签: php

您好,请帮助我如何通过此循环获取说明?

$timepicker = $_POST['timepicker']; 
$discription = $_POST['description'];
foreach( $timepicker as $key => $n ) 
{
print "".$n." ".$discription[$key]."\n";
}

3 个答案:

答案 0 :(得分:0)

<?php 
for ($i = 0, $i<= count($_POST['timepicker']); $i++){
echo $timep=$_POST['timepicker'][$i]."<br>";
echo $name = $_POST['fullname'][$i]."<br>"; // get name
echo $job  = $_POST['description'][$i]."<br>"; // get jobtitle
}

?>

答案 1 :(得分:0)

foreach( $discription as $value) 
{
print $value."\n";
}

答案 2 :(得分:0)

正确的答案是:-

   foreach( $discription as $value) 
   {
   print $value."\n";
   }