php获取多选框的值
2022-07-28 15:09:43
230
{{single.collect_count}}

html中多选框中的name需要用[]修饰

<input type="checkbox" name="hobby[]" value="sleep"/><input type="checkbox" name="hobby[]" value="play"/><input type="checkbox" name="hobby[]" value="study"/>

php中用$_POST[‘name’]获取即可

$hobby=$_POST['hobby'];for($i=0;$i<count($hobby);$i++){ echo $hobby[$i]; }
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}