PHP quiz questions

PHP interview questions

  • 1.

    Which of the following is an associative array of variables passed to the current script via HTTP cookies?

    1. $GLOBALS

    2. $_SERVER

    3. $_COOKIE

    4. $_SESSION

    Answer
  • 2.

    Which of the following function is used to check if a file exists or not?

    1. fopen()

    2. fread()

    3. filesize()

    4. file_exist()

    Answer
  • 3.

    Doubly quoted strings are treated almost literally, whereas singly quoted strings replace variables with their values as well as specially interpreting certain character sequences.

    1. true

    2. false

    Answer
  • 4.

    Which of the following function creates an array?

    1. array()

    2. array_change_key_case()

    3. array_chunk()

    4. array_count_values()

    Answer
  • 5.

    Which of the following array represents an array containing one or more arrays?

    1. Numeric Array

    2. Associative Array

    3. Multidimentional Array

    4. None of the above.

    Answer
  • 6.

    Which of the following is correct about determine the "truth" of any value not already of the Boolean type?

    1. If the value is an array, it is false if it contains no other values, and it is true otherwise. For an object, containing a value means having a member variable that has been assigned a value.

    2. Valid resources are true (although some functions that return resources when they are successful will return FALSE when unsuccessful).

    3. Don't use double as Booleans.

    4. All of the above.

    Answer
  • 7.

    Which of the following is correct about determine the "truth" of any value not already of the Boolean type?

    1. If the value is a number, it is false if exactly equal to zero and true otherwise.

    2. If the value is a string, it is false if the string is empty (has zero characters) or is the string "0", and is true otherwise.

    3. Values of type NULL are always false.

    4. All of the above.

    Answer
  • 8.

     Which of the following is true about php.ini file?

    1. The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality.

    2. The php.ini file is read each time PHP is initialized.

    3. Both of the above.

    Answer
  • 9.

    What is the difference between single-quoted and double-quoted strings in PHP?

    1. A single-quoted string does not have variables within it interpreted. A double-quoted string does.

    2. Also, a double-quoted string can contain apostrophes without backslashes, while a single-quoted string can contain unescaped quotation marks.

    3. The single-quoted strings are faster at runtime because they do not need to be parsed.

    4. All of above are true

    Answer
  • 10.

    What does PHP stand for?

    1. Hypertext Preprocessor

    2. Private Home Page

    3. Personal Hypertext Processor

    Answer

© 2017 QuizBucket.org