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)
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
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
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
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+
37. The function setcookie( ) is used to
- Enable or disable cookie support
- Declare cookie variables
- Store data in cookie variable
- All of above
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
39. fopen($file_doc,”r+”Wink opens a file for
- reading
- writing
- none of above
- both of above
40. In mail($param2, $param2, $param3, $param4), the $param2 contains:
- The message
- The recipient
- The header
- The subject