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.<?php $a="b"; $$a="a!"; echo "$a$b"; ?>运行输出的结果为:( )
A.b$b B.$a$b C.ba! D.ab
11.<?php $a=0x10; echo $a; ?> 输出结果为:( )
A.x10 B.0x10 C.0 D.16
12.PHP中,下列哪个操作符用来连接字符串?( )
A.+ B.. C.& D.*
13.<?php for($i=1;$i<3;$i++) echo $i; echo ","; ?>输出结果为:( )
A.1,2,3 B.1,2, C.1,2 D.12,
14.<?php $a=array(1,'color'=>'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
四、程序分析:(每题2分,共30分)
(说明:写出各PHP程序运行后在浏览器里看到的结果)
1.<?php $score=90; if($score<60) { ?> 你的成绩及格了!
<?php }else{ ?> 你的成绩不及格!<?php } ?>
2.<?php $a=1.3E2; echo $a; ?>