Can You Pass This PHP Quiz?

10 Questions | Total Attempts: 441

Settings
Please wait...
Can You Pass This PHP Quiz?

.


Questions and Answers
  • 1. 
    Which of the following is true about php variables?
    • A. 

      Variables can, but do not need, to be declared before assignment

    • B. 

      Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters.

    • C. 

      Variables used before they are assigned have default values.

    • D. 

      All of the above.

  • 2. 
    Which of the following type of variables have only two possible values either true or false?
    • A. 

      Integers

    • B. 

      Doubles

    • C. 

      Booleans

    • D. 

      Strings

  • 3. 
    Which of the following magic constant of PHP returns function name?
    • A. 

      _LINE_

    • B. 

      _FILE_

    • C. 

      _FUNCTION_

    • D. 

      _CLASS_

  • 4. 
    Which of the following keyword terminates the for loop or switch statement and transfers execution to the statement immediately following the for loop or switch?
    • A. 

      Break

    • B. 

      Continue

  • 5. 
    Which of the following function is used to redirect a page?
    • A. 

      Redirect()

    • B. 

      Header()

    • C. 

      Reflect()

    • D. 

      None of the above

  • 6. 
    Which of the following function returns selected parts of an array?
    • A. 

      Array_reverse()

    • B. 

      Array_search()

    • C. 

      Array_shift()

    • D. 

      Array_slice()

  • 7. 
    Can you assign the default values to a function parameters?
    • A. 

      True

    • B. 

      False

  • 8. 
    Which of the following provides content type of the uploaded file in PHP?
    • A. 

      $_FILES['file']['tmp_name']

    • B. 

      $_FILES['file']['name']

    • C. 

      $_FILES['file']['size']

    • D. 

      $_FILES['file']['type']

  • 9. 
    • A. 

      The preg_match() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise.

    • B. 

      The preg_match() function searches throughout a string specified by pattern for a string specified by string. The search is not case sensitive.

    • C. 

      The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise.

    • D. 

      None of the above

  • 10. 
    Can you create a class in PHP?
    • A. 

      True

    • B. 

      False