PHP MCQ Question and Answer

PHP MCQ Question and Answer
31. A variable $word is set to “HELLO WORLD”, which of the following script returns in title case?
  • echo ucwords($word)
  • echo ucwords(strtolower($word)
  • echo ucfirst($word)
  • echo ucfirst(strtolower($word)
Show Answer
32. The difference between include() and require()
  • are different how they handle failure
  • both are same in every aspects
  • is include() produced a Fatal Error while require results in a Warning
  • none of above
Show Answer
33. When a file is included the code it contains, behave for variable scope of the line on which the include occurs
  • Any variable available at that line in the calling file will be available within the called file from that point
  • Any variable available at that line in the calling file will not be available within the called file
  • Variables are local in both called and calling files
  • None of above
Show Answer
34. Which of the following method sends input to a script via a URL?
  • Get
  • Post
  • Both
  • None
Show Answer
35. Which of the following method is suitable when you need to send larger form submissions?
  • Get
  • Post
  • Both Get and Post
  • There is no direct way for larger form. You need to store them in a file and retrieve
Show Answer
36. Which of the following mode of fopen() function opens a file only for writing. If a file with that name does not exist, attempts to create anew file. If the file exist, place the file pointer at the end of the file after all other data.
  • W
  • W+
  • A
  • A+
Show Answer
37. The function setcookie( ) is used to
  • Enable or disable cookie support
  • Declare cookie variables
  • Store data in cookie variable
  • All of above
Show Answer
38. The function setcookie( ) is used to
  • To work with remote files in PHP you need to enable
  • allow_url_fopen
  • allow_remote_files
  • both of above
Show Answer
39. fopen($file_doc,”r+”Wink opens a file for
  • reading
  • writing
  • none of above
  • both of above
Show Answer
40. In mail($param2, $param2, $param3, $param4), the $param2 contains:
  • The message
  • The recipient
  • The header
  • The subject
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test