php程序设计期末试题,php程序设计试卷A参考答案

发布时间:2022-11-26

本文目录一览:

  1. php程序设计期末考试题目,应该php语言编写程序,mysql数据库服务器创建一个数据库,数据库
  2. php程序设计选择题
  3. PHP程序设计试卷
  4. php简单编程题!!急急急!
  5. php小程序设计题

php程序设计期末考试题目,应该php语言编写程序,mysql数据库服务器创建一个数据库,数据库

如果没具体要求的话,可以百度一个,网上有很多免费的,就是得自己测试是否能用,如果有具体要求就得动手做了,具体私聊哦

php程序设计选择题

a.
a.
a.
d. Select * from employees where 姓名 like ‘%文%’
d.
d.
b.
cd.
b.

PHP程序设计试卷

  1. "php"
  2. ?和?php ; ?php和?
  3. 赋值 ; 判断
  4. 5
  5. 这个题太无聊 是在考转义
  6. 你简直太棒了!
  7. 数据库地址 ; 数据库用户名

php简单编程题!!急急急!

<?php
header('Content-type: text/html; charset=utf-8');
/**
 * 验证用户名,只能有数字字母下划线,不能数字开头,长度6-20
 * @param string $name 用户名
 * @return bool
 */
function username_verify($name) {
    return (bool)preg_match('/^(_|[a-z])\w{5,19}$/i', $name);
}
/**
 * 验证密码:数字,下划线,字母,6-16位
 * @param string $pw 密码
 * @return bool
 */
function password_verify($pw) {
    return (bool)preg_match('/^\w{6,16}$/i', $pw);
}
/**
 * 判断学生成绩等级
 * @param  int $score 成绩
 * @return mixed
 */
function score_level($score) {
    if ($score < 0 || $score > 100) {
        return false;
    }
    if ($score >= 90) {
        return 'a级';
    } elseif ($score >= 80) {
        return 'b级';
    } elseif ($score >= 70) {
        return 'c级';
    }
}

php小程序设计题

<?php
$con = mysql_connect("localhost","root",'123456');
$mysql_select_db("lesson",$con);
mysql_query("set names utf8");
$sql = "select count(*) from student where math>80 and english>80";
$num = mysql_query($sql);
echo "数学和英语成绩均大于等于80分的学生总数:" . $num;
$sql1 = "select * from student where math>80 and english>80";
$arr = mysql_query($sql1);
$str = "<table border='1'><tr><th>姓名</th><th>总分</th></tr>";
while($row = mysql_fetch_assoc($arr)) {
    $str .= "<tr>";
    $str .= "<td>" . $row['name']. "</td>";
    $str .= "<td>" . $row['math']+$row['english']. "</td>";
    $str .= "</tr>";
}
echo $str;
mysql_close($con);