php多选题(php多选题代码)

华为云服务器特价优惠火热进行中!

2核2G2兆仅需 38 元;4核4G3兆仅需 79 元。购买时间越长越优惠!更多配置及优惠价格请咨询客服。

合作流程:
1、点击链接注册/关联华为云账号:点击跳转
2、添加客服微信号:cloud7591,确定产品方案、价格方案、服务支持方案等;
3、客服协助购买,并拉微信技术服务群,享受一对一免费技术支持服务;
技术专家在金蝶、华为、腾讯原厂有多年工作经验,并已从事云计算服务8年,可对域名、备案、网站搭建、系统部署、AI人工智能、云资源规划等上云常见问题提供更专业靠谱的服务,对相应产品提供更优惠的报价和方案,欢迎咨询。

本篇文章给大家谈谈php多选题,以及php多选题代码对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

微信号:cloud7591
如需了解更多,欢迎添加客服微信咨询。
复制微信号

本文目录一览:

php关于字符串的处理(考试多选题),有点难

!doctype html

html

head

meta charset="UTF-8"

titleUntitled Document/title

/head

form action="" method="post" 

     正确答案:input type="text" name='answer'

        答  案   :input type="text" name="stuanswer"

        input type="submit" value="比较答案"

    /form

   ?php

   if(isset($_POST['answer'])isset($_POST['stuanswer'])$_POST['answer']!=''$_POST['stuanswer']!=''){

$str=$_POST['answer'];

$str1=$_POST['stuanswer'];

if(strlen($str1)==strlen($str)){

$count=strlen($str);

for($i=0;$i$count;$i++){

if(!strstr($str1,$str[$i])||!strstr($str,$str1[$i])){

echo "script alert('答案错误');/script";

exit;

}

}echo "script alert('答案正确');/script";

}else{

echo "script alert('答案错误');/script";

}

   }

?

body

/body

/html

//来试试这个代码,正则我不会,只能写这样的代码,你可以测试,我测试结果没有问题

php做一个在线考试系统 不是很会做多选题 希望大神能提供帮助 如何做多选题 和多选题的数据库

给你举个栗子吧,应该能看懂,

这是html:

form action="./test.php" method="post"

你喜欢什么语言?

br

input type="checkbox" name="yuyan[]" value="php"phpnbsp;nbsp;

input type="checkbox" name="yuyan[]" value="java"javanbsp;nbsp;

input type="checkbox" name="yuyan[]" value=".net".netnbsp;nbsp;

input type="checkbox" name="yuyan[]" value="js"jsnbsp;nbsp;

br

input type="submit" value="submit"

/form

前端效果:

这是php:

?php

$yuyan = $_POST['yuyan'];

echo 'pre';

var_dump($yuyan);

php接收数据后输出效果:

PHP程序题:编写回答多项选择题的php程序,具体要求如下图

就帮你写一下好了  我的php文件名称是test.php  你可以改成自己的php文件名称 好像是4zuoy2.php

!DOCTYPE html

html lang="zh-cn"

head

    meta charset="UTF-8" /

    title测试/title

/head

body

    form action="test.php" type="post"

        div class="select-area"

            input type="checkbox" name="program[]" value="1" /AJAX

            input type="checkbox" name="program[]" value="2" /PHP

            input type="checkbox" name="program[]" value="3" /FLASH

            input type="checkbox" name="program[]" value="4" /ASP

            input type="checkbox" name="program[]" value="5" /JSP

        /div

        

        div class="submit-button"

            input type="submit" class="submit"确定/button

        /div

    /form

/body

/html

?php

    !empty($_POST['program']) ? $program = $_POST['program'] : '';

    if ($program) {

        //遍历传递过来的是数组

        if (in_array(2, $program)in_array(4,$program)in_array(5,$program)) {

                    echo '正确';

            }elseif (!in_array(2, $program) || !in_array(4,$program) || !in_array(5,$program)) {

                echo '回答不全!';

            }else{

                echo '错误!';

            }        

    }

?

Php随机的20个单选题,多选题和判断题如何获取答题者的答案

题目随机抽取,在表单里记录题目的id号,比如 input 的name 是qu_34,就表示题目id是34,php就可以通过对post的下标的获取,得出题目id为34,和数据库对比,得到答案是否正确

关于php多选题和php多选题代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

发布于 2023-04-04 06:04:27
收藏
分享
海报
34
目录

    忘记密码?

    图形验证码

    复制成功
    微信号: cloud7591
    如需了解更多,欢迎添加客服微信咨询。
    我知道了