PHP试题带答案

  • 格式:doc
  • 大小:67.00 KB
  • 文档页数:6

下载文档原格式

  / 6
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

(说明:认为陈述正确的在括号内打“√”;否则在括号内打“×”)

1.PHP中变量名“$_abc”不是合法的。()

2.PHP只能使用Mysql数据库。()

3.PHP中的数组键必须为数字,且从“0”开始。()

4.全等运算符“===”在比较时,只有在两者的数据类型和值都相同时才返回True。()5.“mysql_connect( )”与“@mysql_connect( )”没有任何区别。()

6.使用continue语句可以实现PHP程序的跳转。()

7.HTML中的Form表单数据必须使用Submit按钮才可以提交。()

8.PHP中的die()和exit()都可以实现程序中止退出功能。()

9.PHP程序中可以随时嵌入HTML代码和JS代码。()

10.PHP中的Session功能可以完全不受制于客户端的Cookie设置。(

二、填空题:(每空1分,共10分)

1.HTML的Form表单中定义单选按钮需要使用INPUT的类型,定义复选按钮需要使用INPUT的类型。

2.PHP表达式10%2.5值为,表达式10/2.5值为。3.Mysql数据库服务默认开放的端口号是,默认管理员为。4.为了能够避免SQL注入,你需要坚持。

5.表达式“'Testing'.'3'+'5'.'12'”的值为。

6.PHP函数中可以利用向外返回一个值,可以使用声明一个全局变量。

三、单选题:(每题2分,共30分)

(说明:将认为正确答案的字母填写在每小题后而的括号内)

1.输出结果为:()A.123 B.423 C.122 D.413

2.The PHP function that is used to create functions, headers, footers, or elements that will be reused on multiple pages is().

A.require() B.refill() C.reuse() D.None of the Above

3.If you want to come out of a while loop which of the following is used? ()A.exit B.close C.end D.break

4.Which of the following statement about PHP is FALSE?()

A.PHP is a web scripting language.

B.PHP is a client side language.

C.PHP is server-side scripting language that allows you to generate dynamic websites.

D.All the Above

5.Which of the following are valid float values?

A.4.5678 B.4.0 C.7e4 D.All of above

6.Study following steps and determine the correct order

(1) Open a connection to MySQL server

(2) Execute the SQL query

(3) Fetch the data from query

(4) Select database

(5) Close Connection

A.1, 4, 2, 3, 5 B.4, 1, 2, 3, 5 C.1, 5, 4, 2, 1 D.4, 1, 3, 2, 5 7.What is the correct way to add 1 to the $count variable? ( )

A.$count =+1 B.++count C.count++; D.$count++;

8.What is the correct way to create a function in PHP?()

A.function myFunction() B.new_function myFunction()

C.create myFunction() D.void myFunction()

9.下列哪个HTML标记是用来标记图像的?()

A. B. C. D.

10.运行输出的结果为:()A.b$b B.$a$b C.ba! D.ab

11. 输出结果为:()

A.x10 B.0x10 C.0 D.16

12.PHP中,下列哪个操作符用来连接字符串?()

A.+ B.. C.& D.*

13.输出结果为:()A.1,2,3 B.1,2, C.1,2 D.12,

14.'red',2,'name'=>'apple',4); echo $a[2]; ?>输出结果为:()A.red B.4 C.apple D.2

15.下列哪个不是PHP的输出命令:()

A.echo B.printf() C.print D.write

(说明:写出各PHP程序运行后在浏览器里看到的结果)

1. 你的成绩及格了!

你的成绩不及格!

2.