Q. A function in PHP which starts with __ (double underscore) is known as __________ .

  • (A) Inbuilt Function
  • (B) Default Function
  • (C) Magic Function
  • (D) User Defined Function
πŸ’¬ Discuss
βœ… Correct Answer: (C) Magic Function

Q. Which PHP function reads a single character from a file?

  • (A) readcharacter()
  • (B) getchar()
  • (C) fgetc()
  • (D) fchars()
πŸ’¬ Discuss
βœ… Correct Answer: (C) fgetc()

Q. Which PHP function reads a single line from a file?

  • (A) readline()
  • (B) getline()
  • (C) fget()
  • (D) fgets()
πŸ’¬ Discuss
βœ… Correct Answer: (D) fgets()

Q. Which of the following PHP functions accepts any number of parameters?

  • (A) func_get_args()
  • (B) func_get_argv()
  • (C) get_argv()
  • (D) get_argc()
πŸ’¬ Discuss
βœ… Correct Answer: (A) func_get_args()

Q. PHP’s numerically indexed array begin with position ___________ .

  • (A) -1
  • (B) 0
  • (C) 1
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (B) 0

Q. Which of the functions is used to sort an array in descending order?

  • (A) asort()
  • (B) sort()
  • (C) rsort()
  • (D) dsort()
πŸ’¬ Discuss
βœ… Correct Answer: (C) rsort()

Q. Which one of the following property scopes is not supported by PHP?

  • (A) public
  • (B) final
  • (C) friendly
  • (D) static
πŸ’¬ Discuss
βœ… Correct Answer: (C) friendly

Q. How to define a function in PHP?

  • (A) function {function body}
  • (B) functionName(parameters) {function body}
  • (C) function functionName(parameters) {function body}
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) function functionName(parameters) {function body}

Q. what is the latest version of PHP?

  • (A) PHP 3
  • (B) PHP 5
  • (C) PHP 7
  • (D) PHP 8
πŸ’¬ Discuss
βœ… Correct Answer: (D) PHP 8

Q. Which version of php introduced try/catch exception?

  • (A) PHP 5
  • (B) PHP 6
  • (C) PHP 7
  • (D) PHP 8
πŸ’¬ Discuss
βœ… Correct Answer: (A) PHP 5