Q. Which of the following PHP function is used to generate unique id?

  • (A) id()
  • (B) mdid()
  • (C) uniqueid()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) uniqueid()

Q. Which of the following is the correct way of defining a variable in PHP?

  • (A) $variable name = value;
  • (B) $variable_name = value;
  • (C) $variable_name = value
  • (D) $variable name as value;
πŸ’¬ Discuss
βœ… Correct Answer: (B) $variable_name = value;

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

  • (A) The strcmp() function is used to compare the strings excluding case
  • (B) The strcmp() function is used to compare the uppercase strings
  • (C) The strcmp() function is used to compare the lowercase strings
  • (D) The strcmp() function is used to compare the strings including case
πŸ’¬ Discuss
βœ… Correct Answer: (D) The strcmp() function is used to compare the strings including case

Q. What is the use of fopen() function in PHP?

  • (A) The fopen() function is used to open folders in PHP
  • (B) The fopen() function is used to open remote server
  • (C) The fopen() function is used to open files in PHP
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) The fopen() function is used to open files in PHP

Q. What is the use of isset() function in PHP?

  • (A) The isset() function is used to check whether variable is set or not
  • (B) The isset() function is used to check whether the variable is free or not
  • (C) The isset() function is used to check whether the variable is string or not
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) The isset() function is used to check whether variable is set or not

Q. What is the use of sprintf() function in PHP?

  • (A) The sprintf() function is used to print the output of program
  • (B) The sprintf() function is used to send output to variable
  • (C) Both of the above
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) The sprintf() function is used to send output to variable

Q. Which of the following is the correct way to open the file "sample.txt" as readable?

  • (A) fopen("sample.txt", "r");
  • (B) fopen("sample.txt", "r+");
  • (C) fopen("sample.txt", "read");
  • (D) fopen("sample.txt");
πŸ’¬ Discuss
βœ… Correct Answer: (A) fopen("sample.txt", "r");

Q. Which of the following function displays the information about PHP and its configuration?

  • (A) php_info()
  • (B) phpinfo()
  • (C) info()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) phpinfo()

Q. Which of the following function is used to find files in PHP?

  • (A) glob()
  • (B) fold()
  • (C) file()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) glob()

Q. Which of the following function is used to set cookie in PHP?

  • (A) createcookie()
  • (B) makecookie()
  • (C) setcookie()
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) setcookie()