在 Unix Review 上看到这个很有意思的测试,和大家共享。

UnixReview.com

May 2007

Test Your Knowledge of PHP

by Emmett Dulaney

From: http://www.unixreview.com/documents/s=10130/ur0705d/

Increasingly, PHP seems to be the tool/language that is used to make Web sites dynamic. While it is far from the only open source scripting language available, PHP's abilities and features are quickly making it not only a must-have in the Web world but also a topic on many certification exams. Following are fifty questions on PHP at the knowledge level found on beginning/intermediate certification exams. Good luck (answers are at the end of the article)!

1. What is the closing tag used by a PHP-driven web page?

A. />

B. #>

C. ?>

D. .>

2. Which PHP conditional operator means the values are equal AND of the same data type?

A. ==

B. ||

C. ===

D. ==?

3. Which of the following statements is true regarding variables in PHP (choose two)?

A. Variable names in PHP are case sensitive.

B. Variable names in PHP are not case sensitive.

C. PHP variables need to be declared before they can be used.

D. PHP variables do not need to be declared before they can be used.

4. You are evaluating a script written by a previous employee. That script contains a require statement that causes the script to exit when an error occurs. You want to change this so the script will generate a warning when such an error occurs, but keep on running. What should you replace require with?

A. involve

B. need

C. include

D. call_for

5. Which of the following does not represent a comment in a PHP script?

A. // This is a comment

B.

C. # This is a comment

D. /* This is a comment */

6. Which escape character in PHP renders a linefeed?

A. \n

B. \r

C. \t

D. \\

7. What file is used to configure global PHP settings? ______________ (Fill in the blank.)

8. If the value of $AU is currently 7, what is its value as a result of the command $AU++;

A. 8

B. 9

C. 14

D. 49

9. Which printf type specifier is used for a floating point value?

A. d

B. f

C. s

D. u

10. Which PHP logical operator is used to see if both a and b are true?

A. a & b

B. a && b

C. a | b

D. a || b

11. If an array holds 100 entries, which identifier signifies the first entry?

A. 100

B. 99

C. 1

D. 0

12. What function must be called to send the random number generator before array_rand()?

A. limit()

B. scope()

C. srand()

D. hinum()

13. Which two choices below represent the default order resulting from a sort utilizing asort()?

A. A-Z

B. Z-A

C. 0-9

D. 9-0

14. Which of the following is not true for variable names?

A. They can contain an underscore character

B. They can begin with a numeric character

C. They can begin with an alpha character

D. They can contain alphanumeric characters

15. What is the opening tag used on a PHP-driven web page?

A. C. D.

16. What are used to separate blocks of statements within a control structure?

A. brackets [ ]

B. parentheses ( )

C. curly braces { }

D. quotation marks ""

17. Which function can be used to assign a data type to a variable?

A. assign

B. assigntype

C. settype

D. type

18. Which HTTP variable contains the IP address of the machine making a request?

A. ADDR_IP

B. ADDR

C. IP_ADDR

D. REMOTE_ADDR

19. You are creating a simple form for web users to send you a message. Which method should be used with that form?

A. POST

B. GET

C. SEND

D. READ

20. Within your PHP script, you are performing a division operation on two variables. What data type is assigned to the division result, by default, if it is a fractional result?

A. integer

B. double

C. string

D. Boolean

21. Which mode of the fopen() function opens a file for reading or writing, maintains exiting content, and places the file pointer at the beginning of the file?

A. w

B. a

C. r+

D. w+

22. Which function can be used to copy a file?

A. copy()

B. clone()

C. rename()

D. repr()

23. Which of the following is used to set a cookie to expire 24 hours from now?

A. $cookie_expire = time() +24

B. $cookie_expire = time() +1440

C. $cookie_expire = time() +86400

24. Which character is used as a statement terminator to indicate the end of a PHP command?

A. =

B. #

C. |

D. ;

25. Which of the following commands will initialize the $days array?

A. $days = ()

B. $days = array();

C. $days = ""

D. $days = initialize [ ]

E. 12345

F. 12,3,45

G. 1{2,3,4}5

26. What function can be used to see if a file exists?

A. file()

B. file_there()

C. exist_file()

D. file_exists()

27. To create a cookie, your code uses the following entry: SetCookie ("user", "Emmett Dulaney", time() +1800); Which of the following is the best to use to see the value "Emmett Dulaney"?

A. $user

B. $COOKIE[user]

C. $_COOKIE[user]

D. $COOKIE_user

28. Which of the following should be used to combine two or more existing arrays?

A. array_add()

B. array_merge()

C. array_join()

D. array_combine()

29. What function is used to determine whether a session has been started for the current user and then start one if necessary? __________ (Fill in the blank.)

30. After opening a file with the fopen() function, what is used to close the file pointer?

A. fclose()

B. close()

C. die()

D. end()

31. Which of the following functions can be used to show the data type for the $remain variable?

A. echo show($remain);

B. echo gettype($remain);

C. echo type($remain);

D. echo explain($remain);

32. Which of the following functions removes a directory from a file system?

A. rmdir()

B. dir()

C. del()

D. dir_gone()

33. What is the difference between sleep() and usleep()?

A. sleep() suspends operations and usleep() resumes them

B. sleep() accepts seconds and usleep() accepts milliseconds

C. sleep() works for the current process and usleep() works for all processes

D. sleep() can only be specified for the current user and usleep() can be specified for all users

34. You need to know how many elements are in an array. What function should you use to count this?

A. list()

B. count()

C. number()

D. sizeof()

35. Information about a session, by default, is configured in the PHP configuration file to be saved beneath which directory?

A. /var

B. /etc

C. /tmp

D. /usr

36. Which of the following contains variables provided to a script by means of the server environment?

A. $_FILES

B. $_POST

C. $_GET

D. $_ENV

37. Which of the following can be used to delete a file?

A. delete()

B. rid()

C. unlink()

D. close()

38. Which of the following functions can be used to destroy a variable?

A. erase

B. fi

C. remove

D. unset

39. Which mode of the fopen() function opens a file for writing and places the file pointer at the end of the file?

A. w

B. a

C. r+

D. w+

40. Which HTTP variable contains the browser type, and browser version, among other values?

A. BROWSE_AGENT

B. BROWSER_TYPE

C. BROWSER_ENV

D. HTTP_USER_AGENT

41. If the current value of $bsns is 4400, what is the new value as a result of this command: $bsns -= 150;

A. -150

B. 150

C. 4250

D. 4400

E. 4550

F. "4400-150"

42. What are used to enclose conditional expressions?

A. brackets [ ]

B. parentheses ( )

C. curly braces { }

D. quotation marks " "

43. Which PHP data type can be either TRUE or FALSE?

A. Truth

B. Integer

C. Boolean

D. Float

44. Which of the following contains variables provided to a script by means of file uploads?

A. $_FILES

B. $_POST

C. $_GET

D. $_ENV

45. Which constant identifies the highest random number that the system can generate?

A. URAND

B. END_NUMBER

C. ULIMIT

D. RAND_MAX

46. PHP provides support for POSIX through functions of which class?

A. grep

B. ereg

C. psx

D. efgrp

47. From a Boolean standpoint, every zero value in PHP is considered:

A. True

B. False

C. Error

D. Null

48. Which function places results in the opposite order of asort()?

A. arsort()

B. rev()

C. trosa()

D. zsort()

49. Which printf type specifier is used for a string?

A. d

B. f

C. s

D. u

50.Which PHP conditional operator means not equal to?

A. !=

B. =!

C. <=>

D. <>

Answers

1. The closing tag used by PHP is ?>. Answer: C.

2. The PHP conditional operator of three equal signs (===) means the values are equal and of the same data type. Answer: C.

3. PHP variable names are case sensitive and variables do not need to be declared before they can be used. Answer: A and D.

4. The include instruction will create a warning, but allow the script to continue running when an error is encountered. Answer: C.

5. There are at least three ways to create comments in a PHP script, and 6. The \n escape character in PHP renders a linefeed. Answer: A.

7. The global configuration file is php.ini.

8. The command $AU++; increments the variable by one – changing it from 7 to 8. Answer: A.

9. The printf type specifier f is used for a floating point value. Answer: B.

10. The PHP logical operator to use to see if both a and b are true would be a && b. Answer: B.

11. The first entry is 0, the second is 1, and the numbers increment from there. Answer: D.

12. The srand() function must be called to send the random number generator before array_rand(). Answer: C.

13. The default order resulting from a sort utilizing asort() is alphabetic (A-Z) and lowest to highest (0-9). Answer: A and C.

14. Variable names cannot begin with a numeric character. Answer: B.

15. The opening tag used by PHP is

http://www.bkjia.com/PHPjc/318309.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/318309.htmlTechArticle在UnixReview上看到这个很有意思的测试,和大家共享。 UnixReview.com May2007 TestYourKnowledgeofPHP byEmmettDulaney From:http://www.unixreview.com/documents/s=10130...

php 水平测试,测试您的 PHP 水平的题目_PHP教程相关推荐

  1. python课程水平测试成绩查询_学业水平测试成绩查询

    清远2017年中考成绩公布后,市招考办组织专门人员对要求复查成绩的试卷答题卡进行了认真的复核,全市有两人成绩有误,现将清远2017年中考成绩复查结果公布如下:姓名准考号考点科目原分数现分数欧阳斐181 ...

  2. HDU 1407 测试你是否和LTC水平一样高 (HASH)

    测试你是否和LTC水平一样高 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  3. HDU1407 测试你是否和LTC水平一样高 暴力、二分、hash

    测试你是否和LTC水平一样高 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  4. 国家普通话水平智能测试软件,国家普通话水平智能测试系统注意事项

    国家普通话水平智能测试系统注意事项 导语:为了让考生更顺利的通过普通话考试,下面是小编给大家提供的国家普通话水平智能测试系统注意事项,大家可以参考阅读,更多详情请关注应届毕业生考试网. 一.登录阶段: ...

  5. 计算机学业水平测试字处理多少分,【计算机应用论文】计算机应用基础学业水平的测试问题(共3624字)...

    [摘要]本文从学业水平测试的作用,以及学业水平测试的安排进行了阐述,并指出了当前教学中存在的问题和解决的策略,具有一定的借鉴意义. [关键词]学业水平测试:计算机 福建省于2016年下发了<福建 ...

  6. 2019年计算机学业水平测试填空题,2019年计算机学业水平模拟测试选择题80题Word(含参考答案)...

    2019年计算机学业水平模拟测试选择题80题Word(含参考答案) 2019年计算机学业水平测试选择题(10大题80小题) 第一题: 1.1."妈妈把鹏鹏的照片放在快盘里,远方的爷爷奶奶也能 ...

  7. HDU1407 测试你是否和LTC水平一样高【暴力】

    测试你是否和LTC水平一样高 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  8. 青少年计算机等级测试内容,青少年人工智能技术水平测试一级等级考试介绍

    原标题:青少年人工智能技术水平测试一级等级考试介绍 考试介绍 考试级别 青少年人工智能技术水平测试共划分为10个等级,逐级进行考核(难度逐级提升). 参加考试对象:青少年,具体级别的难易程度所对应水平 ...

  9. 2022年襄阳中级工程师职称水平能力测试成绩出来了吗?

    2022年下半年襄阳水平能力测试考试在2月初举行的,目前襄阳水测成绩已出,合格标准已出,襄阳水测今年合格标准是50分及格,以前是30多分及格,今年合格标准突然上涨蛮多,不过大家考的还是不错,分享一波今 ...

最新文章

  1. Java 8 中的这个接口真好用!
  2. 彻底搞懂感受野的含义与计算
  3. CSU 1328: 近似回文词
  4. python—函数进阶-迭代器
  5. python在财务方面的应用-利用python开发财务工具
  6. 连云港职业技术学院有计算机系吗,连云港职业技术学院电子信息工程技术专业...
  7. leetcode 115. Distinct Subsequences Hard | 115. 不同的子序列(动态规划)
  8. 26行代码AC——习题3-2 分子量 (UVa1586,Molar Mass)——解题报告
  9. android config.mk,android编译分析之10—config.mk
  10. python线程状态_python 线程的五个状态
  11. 墨天轮章芋文:用十年打造中国的数据库生态体系
  12. mysql通过命令添加1条数据
  13. java如何简单的将一个三位正整数分解成三个数
  14. linux zip 删除源文件,linux zip命令参数及用法详解--linux压缩zip文件命令
  15. 彻底清除计算机磁盘上的病毒,电脑硬盘病毒无法彻底删除怎么办
  16. python爆破ZIP文件(支持纯数字,数字+字母,密码本)
  17. [转]关于寻路算法的一些思考
  18. 一、C++面向对象高级编程(上) (侯捷)
  19. Python暗通道图像去雾
  20. 【软件安全】API HOOK

热门文章

  1. python清空列表clear_如何在Python中清空列表?
  2. python高阶函数闭包装饰器_5.初识python装饰器 高阶函数+闭包+函数嵌套=装饰器...
  3. matlab 的cat函数
  4. 抓娃娃机爪不动怎么办_黄子韬吃娃娃菜能把临时牙咬断?种植牙到底结实不结实?...
  5. 作为一个算法攻城狮,你训练的算法翻车了该怎么办?
  6. 比亚迪定薪后多久给offer_比亚迪车主给爱车做四门隔音,没想到两年后肠子都悔青...
  7. html中文字过长 自动隐藏,css 实现文字过长自动隐藏功能
  8. mysql1130_解决远程连接mysql错误1130的方法
  9. c语言 指针到字符串,C语言中的指针和字符串
  10. 【原】相煎何太急——input的blur事件与button的click事件