PHP Programming Fundamentals

Comprehensive test covering PHP syntax, variables, arrays, functions, file operations, HTTP methods, and MySQL database interactions.

30 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is not a comment style in PHP?

  1. //
  2. <!__ __>
  3. /* */
  4. #
Question 2 Multiple Choice (Single Answer)

Which of the following is not a PHP tag?

  1. <?php?>
  2. <script language=php> </script>
  3. <? ?>
  4. <?% %>
Question 3 Multiple Choice (Single Answer)

In PHP, each statement terminates with semicolon.

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

In PHP, a variable is represented by a _____ sign followed by the name of variable.

  1. #
  2. $
  3. &
  4. none of these
Question 5 Multiple Choice (Single Answer)

PHP is a _______________ scripting language.

  1. client side
  2. server side
  3. client/server side
  4. none of above
Question 6 Multiple Choice (Single Answer)

The GET method passes argument from in page to the next page as a part of the _____ query string.

  1. SQL
  2. URL
  3. Both (1) and (2)
  4. None of these
Question 7 Multiple Choice (Single Answer)

There is much larger limit on the amount of data that can be passed by using _______ method.

  1. GET
  2. PUT
  3. POST
  4. None of these
Question 8 Multiple Choice (Single Answer)

_________ comparison operator is used to check, if $a is equal to $b and they are of the same type.

  1. <>
  2. ==
  3. =>
  4. ===
Question 9 Multiple Choice (Single Answer)

PHP is an official module of _________ server.

  1. Apache HTTP
  2. ISS
  3. Netscape
  4. Windows NT workstation
Question 10 Multiple Choice (Single Answer)

Which string concatenation operator returns the concatenation of its right and left arguments?

  1. .= (dot & equal)
  2. =.(equal & dot)
  3. . (dot)
  4. ..(double dots)
Question 11 Multiple Choice (Single Answer)

Which one is correct for creating array?

  1. array([key=>] value,.......)
  2. array)key=>value,.........)
  3. Both (1) and (2)
  4. None of these
Question 12 Multiple Choice (Single Answer)

Which of the following is used to re-index an array?

  1. arrange(arrayname)
  2. array_value(arrayname)
  3. reindexed(arrayname)
  4. none of these
Question 13 Multiple Choice (Single Answer)

____________ returns an array comprising a function's argument list.

  1. func_get_arg
  2. func_get_args
  3. func_num_args
  4. none of these
Question 14 Multiple Choice (Single Answer)

__________ returns the number of arguments passed to the function.

  1. func_get_arg
  2. func_get_args
  3. func_num_args
  4. none of these
Question 15 Multiple Choice (Single Answer)

_________ determines whether a variable is a set.

  1. isset
  2. set
  3. exist
  4. none of these
Question 16 Multiple Choice (Single Answer)

Which of the following returns part of haystack string from the first occurrence of needle to the end of haystack with case sensitive?

  1. stristr(string haystack, string needle)
  2. strpos(string haystack, string needle)
  3. strchar(string haystack, string needle)
  4. strstr(string haystack, string needle)
Question 17 Multiple Choice (Single Answer)

Which one of the following assigns variable as if they were arrays?

  1. Assign
  2. Include
  3. List
  4. All of the above
Question 18 Multiple Choice (Single Answer)

What is the original name of PHP?

  1. Personal Web Page
  2. Hypertext Preprocessor
  3. Personal Home Page
  4. Hypertext Processor
Question 19 Multiple Choice (Single Answer)

_________ applies user function to every member of an array.

  1. array_funct
  2. array_walk
  3. array_apply
  4. in_array
Question 20 Multiple Choice (Single Answer)

The full form of PHP is

  1. Hypertext Preprocessor
  2. Public Home Page
  3. Personal Web Page
  4. Personal Home Page
Question 21 Multiple Choice (Single Answer)

Who is the creator of PHP?

  1. Team Berneus Lee
  2. Rasmus Ledorf
  3. Denis Ritchie
  4. None of above
Question 22 Multiple Choice (Single Answer)

________ is used to write a string to a file.

  1. file_put_string
  2. file_put_contents
  3. file_put_char
  4. none of these
Question 23 Multiple Choice (Single Answer)

________ delete(s) a file in PHP.

  1. Destroy
  2. Unlink
  3. Both (1) & (2)
  4. Unlink
Question 24 Multiple Choice (Single Answer)

_________ will cause a fatal error and termination of the script.

  1. require()
  2. require_once()
  3. both (1) and (2)
  4. include
Question 25 Multiple Choice (Single Answer)

You can add PHP to your HTML by putting it in a seperate file and calling it by using PHP's ________ function(s).

  1. call
  2. include
  3. access
  4. both (1) and (2)
Question 26 Multiple Choice (Single Answer)

Cookies are stored on a _______ computer.

  1. client
  2. server
  3. client/server
  4. none of these
Question 27 Multiple Choice (Single Answer)

XML stands for

  1. Xtensible Markup Language
  2. Extensible Markup Language
  3. Extreme Markup Language
  4. None of these
Question 28 Multiple Choice (Single Answer)

___________ is an array containing information such as header, path and script location.

  1. $_COOKIE
  2. $_SESSION
  3. $_REQUEST
  4. $_SERVER
Question 29 Multiple Choice (Single Answer)

_____________ fetches a result row as an associative array, a numeric array or both.

  1. mysql_fetch_row
  2. mysql_fetch_object
  3. mysql_fetch_array
  4. both (1) and (3)
Question 30 Multiple Choice (Single Answer)

_____________ selects mysqldatabase.

  1. mysql_select_database
  2. mysql_select_db
  3. mysql_connect_db
  4. mysql_database