Home >Backend Development >PHP Tutorial >Demo code for php to read checkbox array value

Demo code for php to read checkbox array value

WBOY
WBOYOriginal
2016-07-25 08:58:111010browse
  1. 9341d5cf9b3141e9913a79a1963fd71d
  2. 48dc6218dc017f0936eee41333d70ba4Headline[h]
  3. 2546488c614658d947e309e0416f743aRecommended[c]
  4. a90049e69018a2ed0ed2c55cdedfbd16Slideshow [f]
  5. a62a56589f525bbe3c51052506323443Specially recommended [a]
  6. a33d9b0cf07558626b75907be03268c4Scroll[s]
  7. 8128257cca306556c8cb6331a740ed68Bold[b]
  8. e6ff47138a472da61c5ba0e22054b4e0picture[p]
  9. 94ed3e02ff2501de7f2c045fbf485802
  10. f5a47148e367a6035fd7a2faa965022e
Copy code

Note: The name attribute of the input above has the same content, and they are all 'flags[]'. The reason for adding '[]' is to transfer the content of flags into an array.

2, CheckAction.php file:

<?php
//读取输出
echo implode(",",$_POST['flags']);
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn