你好,請你幫忙,我怎麼能得到這個循環的描述?我如何通過在PHP中的foreach獲得多個文本框值
$timepicker = $_POST['timepicker'];
$discription = $_POST['description'];
foreach($timepicker as $key => $n)
{
print "".$n." ".$discription[$key]."\n";
}
你好,請你幫忙,我怎麼能得到這個循環的描述?我如何通過在PHP中的foreach獲得多個文本框值
$timepicker = $_POST['timepicker'];
$discription = $_POST['description'];
foreach($timepicker as $key => $n)
{
print "".$n." ".$discription[$key]."\n";
}
<?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
}
?>
它只顯示描述,僅顯示timepicker文本框的值... – Siddharth
上述代碼將循環顯示錶單對象的每個計數值。 –
嘗試使用print_r($ job)檢查循環外的描述值 –
foreach($discription as $value)
{
print $value."\n";
}
我想通過foreach timepicker和description獲取兩個值 – Siddharth
我已經使用這個太行: - 爲($ i = 0,$行數= COUNT($ _ POST); – Siddharth
檢查的語法'爲loop' HTTP:// PHP。 net/manual/en/control-structures.for.php – Saty
我也使用foreach循環,但我無法獲得多個文本框值.. – Siddharth