Q. Which of the following is the default file extension of PHP?

  • (A) .php
  • (B) .hphp
  • (C) .xml
  • (D) .html
πŸ’¬ Discuss
βœ… Correct Answer: (A) .php

Q. Which of the following is not a variable scope in PHP?

  • (A) Extern
  • (B) Local
  • (C) Static
  • (D) Global
πŸ’¬ Discuss
βœ… Correct Answer: (A) Extern

Q. Which of the following is correct to add a comment in php?

  • (A) & …… &
  • (B) // ……
  • (C) /* …… */
  • (D) Both (b) and (c)
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both (b) and (c)

Q. Which of the following is used to display the output in PHP?

  • (A) echo
  • (B) write
  • (C) print
  • (D) Both (a) and (c)
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both (a) and (c)

Q. Which of the following is the use of strlen() function in PHP?

  • (A) The strlen() function returns the type of string
  • (B) The strlen() function returns the length of string
  • (C) The strlen() function returns the value of string
  • (D) The strlen() function returns both value and type of string
πŸ’¬ Discuss
βœ… Correct Answer: (B) The strlen() function returns the length of string

Q. Which of the following is used for concatenation in PHP?

  • (A) + (plus)
  • (B) * (Asterisk)
  • (C) . (dot)
  • (D) append()
πŸ’¬ Discuss
βœ… Correct Answer: (C) . (dot)

Q. Which of the following starts with __ (double underscore) in PHP?

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

Q. Which of the following is the use of strpos() function in PHP?

  • (A) The strpos() function is used to search for the spaces in a string
  • (B) The strpos() function is used to search for a number in a string
  • (C) The strpos() function is used to search for a character/text in a string
  • (D) The strpos() function is used to search for a capitalize character in a string
πŸ’¬ Discuss
βœ… Correct Answer: (C) The strpos() function is used to search for a character/text in a string

Q. What does PEAR stands for?

  • (A) PHP extension and application repository
  • (B) PHP enhancement and application reduce
  • (C) PHP event and application repository
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) PHP extension and application repository

Q. Which of the following is the correct way to create a function in PHP?

  • (A) Create myFunction()
  • (B) New_function myFunction()
  • (C) function myFunction()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) function myFunction()