douchenzhan3050 2016-07-04 11:38
浏览 82
已采纳

将php变量传递给HTML输入

My issue is that I want to pass som php-variables to HTML input.

echo $ManuellTagnavnMain;
for ($n = 0; $n < 6; $n++) {
  print_r(++$ManuellTagnavnMain.PHP_EOL);
}

I would like to pass all of the values to HTML input(s). How is this done?

  • 写回答

1条回答 默认 最新

  • dqzlqfqeh845799833 2016-07-04 11:44
    关注
    <?php
    
    echo $ManuellTagnavnMain;
    for ($n = 0; $n < 6; $n++) { ?>
    
    Input: <input type="text" value="<?php echo $n; ?>"/>
    
    <?php
      print_r(++$ManuellTagnavnMain.PHP_EOL);
    }
    ?>
    

    You can set Php values into html elements like this

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?