From 1ae09596a817282056d4b24a58904ef357a5021f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Tue, 7 Jun 2022 09:01:16 +0000 Subject: [PATCH 1/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?05-PHP=E7=89=B5=E6=89=8B=E7=BD=91.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20220605-PHP\347\211\265\346\211\213\347\275\221.md" | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git "a/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" "b/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" index 78f85ae..4f5928f 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" @@ -11,9 +11,8 @@ height DECIMAL(5,2), hobby VARCHAR(50), phone VARCHAR(50), address VARCHAR(200), -aboutname VARCHAR(500), photo binary, -aboutime varchar(500) +aboutme varchar(500) ); ``` @@ -55,7 +54,6 @@ $result = mysqli_query($conn,$sql); - -- Gitee From 15da22a0dc8f3711fe0dd49e311d01cb574392bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Tue, 7 Jun 2022 23:58:42 +0000 Subject: [PATCH 2/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?05-PHP=E7=89=B5=E6=89=8B=E7=BD=91.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20220605-PHP\347\211\265\346\211\213\347\275\221.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" "b/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" index 4f5928f..a76b27d 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220605-PHP\347\211\265\346\211\213\347\275\221.md" @@ -79,7 +79,7 @@ $result = mysqli_query($conn,$sql); - + Date: Wed, 8 Jun 2022 03:39:22 +0000 Subject: [PATCH 3/7] a --- ...41\345\244\247\344\275\234\344\270\232.md" | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 "\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" diff --git "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" new file mode 100644 index 0000000..3061df0 --- /dev/null +++ "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" @@ -0,0 +1,96 @@ + # PHP̬վһδҵ +һѡ⣨8֣ +1phpȷǣD +A.var a = 5; +B.int b = 6; +C.var $a = 12; +D.$a = 10; +2ԴѭִеĴǣA +```php + +A.0 +B.1 +C.2 +D.3 +3ʱֵ֮ķָǣB +A.-> +B.=> +C.: +D.# +4˵ȷǣD +A. ±Ϊ֣Ҵӡ0ʼ +B. ± +C. еԪͱһ +D. ±ַ +⣨12֣ +1:PHPбЩ? +(1).boolean: +(2).stringַ +(3).int +(4).float +2:Щ +1.䣺ifelseelse ifswitch +2.ѭ䣺foreachwhiledo whilefor +3.תƿ䣺breakcontinuereturn +⣨50֣ + 1洢Լ䣬Ա𣬿Գɼ10֣ +```php + + + + +
用户名密码 性别 身高 爱好
+ "; + for ($j=1;$j<=$i;$j++){ + echo ""; +} +?> +
{$j}*{$i}=".($j*$i).""; + } + echo "
+ + +``` +41100ڵ15֣ +ڴ1ȻУ1ⲻȻ +```php +"red","b"=>"green","c"=>"blue"); + 3ַ.ɢΪ飬ַ£$str = "www.mxdx.com";10֣ + + -- Gitee From fe2f11f56dc486175af769d998f888d3f7a2f970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Wed, 8 Jun 2022 03:40:11 +0000 Subject: [PATCH 4/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?08-PHP=E5=8A=A8=E6=80=81=E7=BD=91=E7=AB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=A4=A7=E4=BD=9C=E4=B8=9A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\345\244\247\344\275\234\344\270\232.md" | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" index 3061df0..f6de985 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" @@ -1,11 +1,11 @@ - # PHP̬վһδҵ -һѡ⣨8֣ -1phpȷǣD + # PHP动态网站开发第一次大作业 +一、选择题(8分) +1、php定义变量正确的是(D) A.var a = 5; B.int b = 6; C.var $a = 12; D.$a = 10; -2ԴѭִеĴǣA +2、下列语言代码的循环体执行的次数是(A) ```php B.=> C.: D.# -4˵ȷǣD -A. ±Ϊ֣Ҵӡ0ʼ -B. ± -C. еԪͱһ -D. ±ַ -⣨12֣ -1:PHPбЩ? -(1).boolean: -(2).stringַ -(3).int -(4).float -2:Щ -1.䣺ifelseelse ifswitch -2.ѭ䣺foreachwhiledo whilefor -3.תƿ䣺breakcontinuereturn -⣨50֣ - 1洢Լ䣬Ա𣬿Գɼ10֣ +4、下列说法正确的是(D) +A. 数组的下标必须为数字,且从“0”开始 +B. 数组的下标必须是连续的 +C. 数组中的元素类型必须一致 +D. 数组的下标可以是字符串 弱类型语言 +二、简答题(12分) +1:PHP中变量有哪些基本数据类型? +(1).boolean:布尔类型 +(2).string:字符串类型 +(3).int:整数类型 +(4).float:浮点类型 +2:控制流程语句有哪些? +(1).条件控制语句:if,else,else if,switch +(2).循环控制语句:foreach,while,do while,for +(3).转移控制语句:break,continue,return +三、编程题(50分) + 1、定义变量存储自己的姓名,年龄,性别,考试成绩。并进行输出(10分) ```php @@ -82,15 +82,15 @@ for ($i=1;$i<=9;$i++){ ``` -41100ڵ15֣ -ڴ1ȻУ1ⲻȻ +4、求1到100内的素数?(15分) +(素数是在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数) ```php "red","b"=>"green","c"=>"blue"); - 3ַ.ɢΪ飬ַ£$str = "www.mxdx.com";10֣ + 3、把字符串按照.打散为数组,字符串如下:$str = "www.mxdx.com";(10分) -- Gitee From ef63d15a2cee294bcb44c0b678fac8d7f8bcf109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Thu, 9 Jun 2022 16:28:51 +0000 Subject: [PATCH 5/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?08-PHP=E5=8A=A8=E6=80=81=E7=BD=91=E7=AB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=A4=A7=E4=BD=9C=E4=B8=9A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\345\244\247\344\275\234\344\270\232.md" | 56 +++++++++++++++++-- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" index f6de985..1d816d2 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" @@ -1,4 +1,5 @@ # PHP动态网站开发第一次大作业 + 一、选择题(8分) 1、php定义变量正确的是(D) A.var a = 5; @@ -6,6 +7,7 @@ B.int b = 6; C.var $a = 12; D.$a = 10; 2、下列语言代码的循环体执行的次数是(A) + ```php +``` + A.0 B.1 C.2 @@ -41,6 +44,7 @@ D. 数组的下标可以是字符串 弱类型语言 (3).转移控制语句:break,continue,return 三、编程题(50分) 1、定义变量存储自己的姓名,年龄,性别,考试成绩。并进行输出(10分) + ```php @@ -82,15 +89,56 @@ for ($i=1;$i<=9;$i++){ ``` + 4、求1到100内的素数?(15分) (素数是在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数) + ```php '; + continue; + } + if ($i==2){ + echo $i,'是素数','
'; + } + for($j=2;$j<$i;$j++){ + if($i % $j == 0){ + $b=false; + } + } + if ($b){ + echo $i,'是素数','
'; + } + } ``` + 四、操作题(30分) -1、定义一个关联数组,数组里面有4个元素,这4个元素分别存放的是自 己的姓名,年龄,性别,考试成绩。并进行输出?(10分) +1、定义一个关联数组,数组里面有4个元素,这4个元素分别存放的是自己的姓名,年龄,性别,考试成绩。并进行输出?(10分) + +```php +$arr =array("name"=>"汤亦凡","age"=>"20","sex"=>"女","score"=>80); +foreach ($arr as $key =>$value){ + echo "$key=".$value."
"; + +} +``` + 2、在数组中搜索键值 "red",并返回它的键名。数组如下所示:(10分) $a=array("a"=>"red","b"=>"green","c"=>"blue"); - 3、把字符串按照.打散为数组,字符串如下:$str = "www.mxdx.com";(10分) +```php +$a=array("a"=>"red","b"=>"green","c"=>"blue"); +echo array_search("red",$a); +``` + +​ 3、把字符串按照.打散为数组,字符串如下:$str = "www.mxdx.com";(10分) + +```php +$str = "www.mxdx.com"; +$namestr=explode(".",$str); +// var_dump($namestr); +``` -- Gitee From 2b60a6fb66f44f37c596c1eecab8a081dc602499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Thu, 9 Jun 2022 16:30:05 +0000 Subject: [PATCH 6/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?08-PHP=E5=8A=A8=E6=80=81=E7=BD=91=E7=AB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=A4=A7=E4=BD=9C=E4=B8=9A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\345\244\247\344\275\234\344\270\232.md" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" index 1d816d2..75f9616 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" @@ -2,10 +2,14 @@ 一、选择题(8分) 1、php定义变量正确的是(D) + +``` A.var a = 5; B.int b = 6; C.var $a = 12; D.$a = 10; +``` + 2、下列语言代码的循环体执行的次数是(A) ```php @@ -18,30 +22,49 @@ while($n==0){ ?> ``` +``` A.0 B.1 C.2 D.3 +``` + 3、定义关联数组的时,其键名与值之间的分隔符是(B) + +``` A.-> B.=> C.: D.# +``` + 4、下列说法正确的是(D) + +``` A. 数组的下标必须为数字,且从“0”开始 B. 数组的下标必须是连续的 C. 数组中的元素类型必须一致 D. 数组的下标可以是字符串 弱类型语言 +``` + 二、简答题(12分) 1:PHP中变量有哪些基本数据类型? + +``` (1).boolean:布尔类型 (2).string:字符串类型 (3).int:整数类型 (4).float:浮点类型 +``` + 2:控制流程语句有哪些? + +``` (1).条件控制语句:if,else,else if,switch (2).循环控制语句:foreach,while,do while,for (3).转移控制语句:break,continue,return +``` + 三、编程题(50分) 1、定义变量存储自己的姓名,年龄,性别,考试成绩。并进行输出(10分) -- Gitee From 04fb5cf616bd924b1fec4470ca94b5ce086627b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E4=BA=A6=E5=87=A1?= <1044020597@qq.com> Date: Sun, 12 Jun 2022 06:28:13 +0000 Subject: [PATCH 7/7] =?UTF-8?q?update=20=E6=B1=A4=E4=BA=A6=E5=87=A1/202206?= =?UTF-8?q?08-PHP=E5=8A=A8=E6=80=81=E7=BD=91=E7=AB=99=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=A4=A7=E4=BD=9C=E4=B8=9A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00\346\254\241\345\244\247\344\275\234\344\270\232.md" | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" index 75f9616..5124c41 100644 --- "a/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" +++ "b/\346\261\244\344\272\246\345\207\241/20220608-PHP\345\212\250\346\200\201\347\275\221\347\253\231\345\274\200\345\217\221\347\254\254\344\270\200\346\254\241\345\244\247\344\275\234\344\270\232.md" @@ -1,6 +1,6 @@ # PHP动态网站开发第一次大作业 -一、选择题(8分) +#### 一、选择题(8分) 1、php定义变量正确的是(D) ``` @@ -47,7 +47,7 @@ C. 数组中的元素类型必须一致 D. 数组的下标可以是字符串 弱类型语言 ``` -二、简答题(12分) +#### 二、简答题(12分) 1:PHP中变量有哪些基本数据类型? ``` @@ -65,7 +65,7 @@ D. 数组的下标可以是字符串 弱类型语言 (3).转移控制语句:break,continue,return ``` -三、编程题(50分) +#### 三、编程题(50分) 1、定义变量存储自己的姓名,年龄,性别,考试成绩。并进行输出(10分) ```php @@ -138,7 +138,7 @@ for ($i=1;$i<=100;$i++) { } ``` -四、操作题(30分) +#### 四、操作题(30分) 1、定义一个关联数组,数组里面有4个元素,这4个元素分别存放的是自己的姓名,年龄,性别,考试成绩。并进行输出?(10分) ```php -- Gitee