PHP MCQ Questions and Answers

Practice Mode
Showing 10 of 130 questions
Q31
A variable $word is set to "HELLO WORLD", which of the following script returns in title case?
  • A echo ucwords($word)
  • B echo ucwords(strtolower($word)
  • C echo ucfirst($word)
  • D echo ucfirst(strtolower($word)
Answer: Option B
Q32
The difference between include() and require()
  • A are different how they handle failure
  • B both are same in every aspects
  • C is include() produced a Fatal Error while require results in a Warning
  • D none of above
Answer: Option A
Q33
When a file is included the code it contains, behave for variable scope of the line on which the include occurs
  • A Any variable available at that line in the calling file will be available within the called file from that point
  • B Any variable available at that line in the calling file will not be available within the called file
  • C Variables are local in both called and calling files
  • D None of above
Answer: Option A
Q34
Which of the following method sends input to a script via a URL?
  • A Get
  • B Post
  • C Both
  • D None
Answer: Option A
Q35
Which of the following method is suitable when you need to send larger form submissions?
  • A Get
  • B Post
  • C Both Get and Post
  • D There is no direct way for larger form. You need to store them in a file and retrieve
Answer: Option B
Q36
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.
  • A W
  • B W+
  • C A
  • D A+
Answer: Option C
Q37
The function setcookie( ) is used to
  • A Enable or disable cookie support
  • B Declare cookie variables
  • C Store data in cookie variable
  • D All of above
Answer: Option C
Q38
The function setcookie( ) is used to
  • A To work with remote files in PHP you need to enable
  • B allow_url_fopen
  • C allow_remote_files
  • D both of above
Answer: Option A
Q39
fopen($file_doc,"r+"Wink opens a file for
  • A reading
  • B writing
  • C none of above
  • D both of above
Answer: Option D
Q40
In mail($param2, $param2, $param3, $param4), the $param2 contains:
  • A The message
  • B The recipient
  • C The header
  • D The subject
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test