返回

PHP工程师笔试选择题

  • 啊南
  • 1805阅读
  • 2020.04.01

选择题,对于基础不扎实的人来说,有句话可以这样说明,失分容易得分难。对于基础扎实的朋友来说,简单到不行,闭着眼睛都能选出来。想知道自己是哪种人吗?可测试,做一下以下关于PHP工程师的题目你就知道了。

PHP工程师笔试选择题10例
1.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 
2.If you want to come out of a while loop which of the following is used? (      ) 
A.exit            B.close        C.end         D.break 
3.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 
4.Which of the following are valid float values? 
A.4.5678         B.4.0         C.7e4        D.All of above 
5.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 
6.What is the correct way to add 1 to the $count variable? (      ) 
A.$count =+1    B.++count   C.count++;    D.$count++; 
7.What is the correct way to create a function in PHP?(     ) 
A.function myFunction()     B.new_function myFunction() C.create myFunction()       D.void myFunction() 
8.PHP中,下列哪个操作符用来连接字符串?(      ) 
A.+      B..       C.&          D.* 
9.'red',2,'name'=>'apple',4); echo $a[2]; ?>输出结果为:(       ) 
A.red      B.4       C.apple         D.2 
10.下列哪个不是PHP的输出命令:(       ) 
A.echo     B.printf()     C.print     D.write
PHP工程师笔试选择题15例
1、下列哪些是PHP的配置文件(     ) 
A.Php.exe  B.Php.ini  C.httpd.conf  D.php_mysqli.dll 
2、以下PHP代码输出的结果是(     ) 
A.99  B.100  C.101  D.102  
3、PHP中的逻辑与运算符是(     ) 
A.&  B.or  C.&&  D.|| 
4、在 ?:运算符当中,条件表达式应该写在什么位置(     ) 
A.?号前面的位置   B.?号后面,:号前面的位置   C.:号后面的位置   D.?:不是运算符  
5、关于PHP中的各种循环,说法正确的是(     ) 
A.do...while 是先判断再运行循环 B.foreach 语句用于遍历数组 C.while  是先循环再判断条件 D.for语句与do...while的功能相同。 
6、PHP中使用什么技术控制会话(     ) 
A.Cookie  B.Session  C.Application  D.Server 
7、以下不正确的PHP变量名是(     ) 
A.$hello_Wuhan    B.$_hellowuhan C.$9helloWuhan   D.$helloWhan 
8、$_GET['id'] 表示什么含义(     ) 
A.接收URL传递过来的参数id的值 B.获取表单使用post方法提交的值  C.发送参数给其它页面 D.以上说法都不正确  
9、关于switch语句说法正确的是(     ) 
A.与if...else语句的作用相同   B.default 语句可以没有 C.break   语句是必须的    D.default 语句是必须的 
10、mysql_connect 函数的第三个参数是(     ) 
A.主机名  B.数据库密码  C.数据库用户名  D.本机IP地址  
11、PHP中正确的常量定义语句是(    )。
A.$age=20;  B.define $AGE=20;  C.define("AGE",20); D.define(AGE=20); 
12、PHP中的注释方法,以下正确的是(     ) 
A.//      B.\*    *\   C.\\   D.<!--...-->     
13、以下不属于PHP数据类型的是(     ) 
A.字符串型   B.日期类型   C. 浮点型   D. 空类型 
14、以下脚本执行的结果是(     ) 
$x = 5;  
if($x = 3){   
    echo "北京";  
}else{ 
    echo "上海";  

A.输出上海           B.输出北京           C. 什么都不输出          D.语法有错误  
15、PHP中用来选择数据库的函数是(       )。
A.mysql_query     B.mysql_fetch_assoc         C.mysql_connect     D.mysql_select_db
PHP工程师笔试选择题20例
1、PHP 指的是? B
A、Private Home Page  B、Personal Hypertext Processor    C、php: Hypertext Preprocessor D、Personal Home Page 
2、PHP 服务器脚本由哪个分隔符包围? C 
A、<?php>...</?>     B、<script>...</script>      C、<?php…?>    D、<&>...</&>
3、如何使用 PHP 输出 "hello world"? B
A、"Hello World";     B、echo "Hello World";    C、Document.Write("Hello World"); 
4、在 PHP 中,所有的变量以哪个符号开头? C
A、! B、& C、$  
5、结束 PHP 语句的正确方法是? C
A、</php>    B、New line    C、;    D、. 
6、PHP 语法与下列哪种最相似? C
A、VBScript    B、JavaScript     C、Perl 和 C  
7、如何从使用 "get" 方法提交的表单中获取数据? A
A、$_GET[]; B、Request.QueryString; C、Request.Form; 
8、请判断以下说法是否正确:当使用 POST 方法时,变量显示在 URL 中。 B
A、正确 B、错误  
9、请判断以下说法是否正确:在 PHP 中,既可以使用单引号 ( ' ' ) 也可以使用双引号 ( " " ) 来包围字符串。 A
A、正确 B、错误  
10、请判断以下说法是否正确:包含文件必须使用文件后缀 ".inc"。 B
A、正确 B、错误 
11、引用文件 "time.inc" 的正确方法是? A
A、<?php require("time.inc"); ?>    B、<!--include file="time.inc"-->  B、<!--include file="time.inc"-->     D、<% include file="time.inc" %>  
12、在 PHP 中创建函数的正确方法是? A
A、function myFunction() B、create myFunction()  C、new_function myFunction() 
13、以只读模式打开文件 "time.txt" 的正确方法是? D
A、fopen("time.txt","r+"); B、open("time.txt"); C、open("time.txt","read"); D、fopen("time.txt","r"); 
14、请判断以下说法是否正确:PHP 允许我们直接通过脚本来发送电子邮件。 A
A、正确 B、错误  
15、连接 MySQL 数据库的正确方法是? B
A、mysql_open("localhost"); B、mysql_connect("localhost"); C、connect_mysql("localhost"); D、dbopen("localhost"); 
16、给 $count 变量加 1 的正确方法是? B
A、++count B、$count++; C、count++; D、$count =+1 
17、在 PHP 中,添加注释的正确方法是? D
A、<!--…--> B、<comment>…</comment>   C、*\..\* D、/*…*/
18、请判断以下说法是否正确:PHP 可以在 Microsoft Windows IIS (Internet Information Server) 上运行。 A
A、正确 B、错误 
19、请判断以下说法是否正确:在 PHP 5 中,在默认情况下 mysql 支持是启用的。 B
A、正确 B、错误  
20、以下的变量名,哪个是不合法的? C
A、$my_Var B、$myVar C、$my-Var 

相关百科