InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Which function is used to split a string into a series of substrings, with each string boundary is determined by a specific separator?(a) break()(b) divide()(c) explode()(d) md5()I had been asked this question by my school teacher while I was bunking the class.This question is from User Authentication topic in division File and Session Handling in PHP of PHP |
|
Answer» The correct ANSWER is (C) explode() |
|
| 52. |
Which is the most powerful authentication method among the four?(a) Hard-coding a loginpair directly into the script(b) File-based authentication(c) Data-based authentication(d) PEAR’S HTTP authenticationI got this question in an online interview.This interesting question is from User Authentication topic in chapter File and Session Handling in PHP of PHP |
|
Answer» The correct choice is (c) Data-based authentication |
|
| 53. |
The authenticationFile.txt, the file which stores username and password should be stored ___ the server document root.(a) Inside(b) Outside(c) Within(d) None of the mentionedI had been asked this question in a national level competition.Enquiry is from User Authentication in portion File and Session Handling in PHP of PHP |
|
Answer» The correct option is (B) Outside |
|
| 54. |
In which authentication method does changing the username or password can be done only by entering the code and making the manual adjustment.(a) Hard-coding a loginpair directly into the script(b) File-based authentication(c) Data-based authentication(d) PEAR’S HTTP authenticationThe question was posed to me during an interview.The query is from User Authentication topic in division File and Session Handling in PHP of PHP |
|
Answer» The CORRECT CHOICE is (a) Hard-coding a loginpair directly into the script |
|
| 55. |
Which function is used to verify whether a variable contains a value?(a) header()(b) footer()(c) inset()(d) isset()I have been asked this question by my college professor while I was bunking the class.Question is from User Authentication in section File and Session Handling in PHP of PHP |
|
Answer» Right answer is (d) isset() |
|
| 56. |
How many predefined variables does PHP use to authenticate a user?(a) 1(b) 2(c) 3(d) 4The question was posed to me at a job interview.My question is taken from User Authentication topic in division File and Session Handling in PHP of PHP |
|
Answer» Correct answer is (B) 2 |
|
| 57. |
How many validation filters like FILTER_VALIDATE_EMAIL are currently available?(a) 5(b) 6(c) 7(d) 8The question was asked in an internship interview.I would like to ask this question from HTML Forms topic in section File and Session Handling in PHP of PHP |
|
Answer» The CORRECT answer is (C) 7 |
|
| 58. |
To validate an email address, which flag is to be passed to the function filter_var()?(a) FILTER_VALIDATE_EMAIL(b) FILTER_VALIDATE_MAIL(c) VALIDATE_EMAIL(d) VALIDATE_MAILThis question was posed to me in an online interview.This question is from HTML Forms topic in section File and Session Handling in PHP of PHP |
|
Answer» CORRECT OPTION is (a) FILTER_VALIDATE_EMAIL Explanation: The FILTER_VALIDATE_EMAIL is USED to VALIDATES an e-mail ADDRESS. |
|
| 59. |
Which function is used to remove all HTML tags from a string passed to a form?(a) remove_tags()(b) strip_tags()(c) tags_strip()(d) tags_remove()I have been asked this question in a job interview.Question is taken from HTML Forms topic in division File and Session Handling in PHP of PHP |
|
Answer» Right option is (b) strip_tags() |
|
| 60. |
Which one of the following should not be used while sending passwords or other sensitive information?(a) GET(b) POST(c) REQUEST(d) NEXTThe question was asked in exam.The question is from HTML Forms topic in section File and Session Handling in PHP of PHP |
|
Answer» The correct choice is (a) GET |
|
| 61. |
Which variable is used to collect form data sent with both the GET and POST methods?(a) $BOTH(b) $_BOTH(c) $REQUEST(d) $_REQUESTThe question was posed to me in final exam.The above asked question is from HTML Forms topic in chapter File and Session Handling in PHP of PHP |
|
Answer» CORRECT CHOICE is (d) $_REQUEST Easy explanation: In PHP the global variable $_REQUEST is used to collect DATA after submitting an HTML FORM. |
|
| 62. |
When you use the $_POST variable to collect data, the data is visible to ___________(a) none(b) only you(c) everyone(d) selected fewI got this question in unit test.I need to ask this question from HTML Forms in portion File and Session Handling in PHP of PHP |
|
Answer» Right choice is (b) only you |
|
| 63. |
When you use the $_GET variable to collect data, the data is visible to ___________(a) none(b) only you(c) everyone(d) selected fewThis question was posed to me during an interview.My doubt is from HTML Forms in division File and Session Handling in PHP of PHP |
|
Answer» The CORRECT OPTION is (c) everyone |
|
| 64. |
The attack which involves the insertion of malicious code into a page frequented by other users is known as _______________(a) basic sql injection(b) advanced sql injection(c) cross-site scripting(d) scriptingThe question was posed to me in homework.I want to ask this question from HTML Forms in portion File and Session Handling in PHP of PHP |
|
Answer» Correct choice is (c) cross-site scripting |
|
| 65. |
Which two predefined variables are used to retrieve information from forms?(a) $GET & $SET(b) $_GET & $_SET(c) $__GET & $__SET(d) GET & SETThis question was posed to me in an interview for internship.My doubt is from HTML Forms in portion File and Session Handling in PHP of PHP |
|
Answer» Right answer is (b) $_GET & $_SET |
|
| 66. |
Which method enables you to calculate whether daylight saving time is in force at a specific date and time?(a) getOffset()(b) getTranitions()(c) ISODate()(d) savingTime()I had been asked this question in examination.This intriguing question originated from Working with Dates in portion File and Session Handling in PHP of PHP |
|
Answer» Right ANSWER is (b) getTranitions() |
|
| 67. |
Which of the following statements can be used to add two months to the existing date?(a) $date->modify(‘+2 months’);(b) $date = modify(‘+2 months’);(c) $date = modify(‘2+ months’);(d) $date->modify(‘2+ months’);I have been asked this question in a national level competition.Query is from Working with Dates in division File and Session Handling in PHP of PHP |
|
Answer» Right choice is (a) $date->MODIFY(‘+2 months’); |
|
| 68. |
Which of the following statements can be used to set the time zone in individual scripts?(a) date_set_timezone(‘Europe/London’);(b) date_default_timezone_set(‘Europe/London’);(c) date_set_default_timezone(‘Europe/London’);(d) date_default_timezone(‘Europe/London’);I had been asked this question during an interview for a job.My query is from Working with Dates in section File and Session Handling in PHP of PHP |
|
Answer» The correct answer is (b) date_default_timezone_set(‘Europe/London’); |
|
| 69. |
Which of the following is the right way to use the DateTime class?(a) $date = get_Class(DateTime);(b) $date = class DateTime;(c) $date = new DateTime();(d) $date = new class DateTime();The question was posed to me by my school principal while I was bunking the class.Query is from Working with Dates topic in chapter File and Session Handling in PHP of PHP |
|
Answer» Correct choice is (c) $date = new DateTime(); |
|
| 70. |
Which method is simply an object-oriented version of date()?(a) DateTime::format()(b) DateTime::modify()(c) DateTime::setTime()(d) DateTime::setDate()The question was posed to me during an online exam.I want to ask this question from Working with Dates topic in division File and Session Handling in PHP of PHP |
|
Answer» Correct option is (a) DateTime::FORMAT() |
|
| 71. |
How many constants does the DateTime class have?(a) 8(b) 9(c) 10(d) 11I had been asked this question in an online quiz.This is a very interesting question from Working with Dates topic in chapter File and Session Handling in PHP of PHP |
|
Answer» The correct ANSWER is (d) 11 |
|
| 72. |
How many methods does the DateTime class have?(a) 8(b) 9(c) 10(d) 11This question was addressed to me in final exam.Enquiry is from Working with Dates in division File and Session Handling in PHP of PHP |
|
Answer» The correct answer is (B) 9 |
|
| 73. |
To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?(a) $date = Date(“22 JUNE 2013”)(b) $date = new Date(“JUNE 22 2013”)(c) $date = DateTime(“22 JUNE 2013”)(d) $date = new DateTime(“22 JUNE 2013”)I have been asked this question during an interview for a job.Asked question is from Date and Timestamp topic in chapter File and Session Handling in PHP of PHP |
|
Answer» Correct OPTION is (d) $date = NEW DateTime(“22 JUNE 2013”) |
|
| 74. |
Suppose you want to calculate the date 45 days from the present date which one of the following statement will you use?(a) totime(“+45”)(b) totime(“+45 days”)(c) strtotime(“+45 days”)(d) strtotime(“-45 days”)This question was addressed to me in quiz.This intriguing question comes from Date and Timestamp in section File and Session Handling in PHP of PHP |
|
Answer» Correct answer is (C) strtotime(“+45 days”) |
|
| 75. |
Which function displays the web page’s most recent modification date?(a) lastmod()(b) getlastmod()(c) last_mod()(d) get_last_mod()The question was asked by my school principal while I was bunking the class.Question is from Date and Timestamp in division File and Session Handling in PHP of PHP |
|
Answer» CORRECT choice is (b) getlastmod() To elaborate: The FUNCTION getlastmod() gets the TIME of the last MODIFICATION of the main script of execution. It returns the value of the page’s last MODIFIED header or FALSE in the case of an error. |
|
| 76. |
Which one of the following function is useful for producing a timestamp based on a given date and time?(a) time()(b) mktime()(c) mrtime()(d) mtime()The question was posed to me by my school principal while I was bunking the class.Query is from Date and Timestamp topic in portion File and Session Handling in PHP of PHP |
|
Answer» The correct choice is (b) mktime() |
|
| 77. |
If the format is F then which one of the following will be returned?(a) Complete text representation of month(b) Day of month, with leading zero(c) Daylight saving time(d) Day of month, without zerosI had been asked this question during a job interview.Origin of the question is Date and Timestamp topic in portion File and Session Handling in PHP of PHP |
|
Answer» The correct answer is (a) Complete text representation of MONTH |
|
| 78. |
Which one of the following format parameter can be used to identify timezone?(a) T(b) N(c) E(d) IThis question was posed to me during an interview.My question is based upon Date and Timestamp in division File and Session Handling in PHP of PHP |
|
Answer» The CORRECT choice is (c) E |
|
| 79. |
The date() function returns ___ representation of the current date and/or time.(a) Integer(b) String(c) Boolean(d) FloatThis question was posed to me during an interview for a job.The above asked question is from Date and Timestamp in portion File and Session Handling in PHP of PHP |
|
Answer» The correct ANSWER is (b) String |
|
| 80. |
Which one of the following function reads a directory into an Array?(a) scandir()(b) readdir()(c) scandirectory()(d) readdirectory()I have been asked this question in final exam.The doubt is from File System and PHP topic in division File and Session Handling in PHP of PHP |
|
Answer» The correct option is (a) scandir() |
|
| 81. |
Which function is useful when you want to output the executed command result?(a) out_cmm()(b) out_system()(c) cmm()(d) system()This question was posed to me by my school principal while I was bunking the class.My query is from File System and PHP in division File and Session Handling in PHP of PHP |
|
Answer» The CORRECT choice is (d) system() |
|
| 82. |
Which function sets the file filename last-modified and last-accessed times?(a) sets()(b) set()(c) touch()(d) touched()The question was asked in exam.Origin of the question is File System and PHP in division File and Session Handling in PHP of PHP |
|
Answer» Correct choice is (C) touch() |
|
| 83. |
Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?(a) fgetsh()(b) fgetsp()(c) fgetsa()(d) fgetss()The question was asked in semester exam.Question is taken from File System and PHP in section File and Session Handling in PHP of PHP |
|
Answer» The correct ANSWER is (d) fgetss() |
|
| 84. |
Which one of the following function is capable of reading a specific number of characters from a file?(a) fgets()(b) fget()(c) fileget()(d) filegets()The question was asked in a national level competition.The origin of the question is File System and PHP in portion File and Session Handling in PHP of PHP |
|
Answer» Correct choice is (a) FGETS() |
|
| 85. |
Which one of the following function outputs the contents of a string variable to the specified resource?(a) filewrite()(b) fwrite()(c) filewrites()(d) fwrites()This question was posed to me in an interview.This is a very interesting question from File System and PHP in section File and Session Handling in PHP of PHP |
|
Answer» Right option is (b) fwrite() |
|
| 86. |
Which one of the following function is capable of reading a file into an array?(a) file()(b) arrfile()(c) arr_file()(d) file_arr()This question was posed to me during an online interview.I would like to ask this question from File System and PHP in section File and Session Handling in PHP of PHP |
|
Answer» The CORRECT ANSWER is (a) FILE() |
|
| 87. |
Which one of the following function is capable of reading a file into a string variable?(a) file_contents()(b) file_get_contents()(c) file_content()(d) file_get_content()This question was addressed to me during an internship interview.Asked question is from File System and PHP in section File and Session Handling in PHP of PHP |
|
Answer» The correct choice is (b) file_get_contents() |
|
| 88. |
Which one of the following PHP function is used to determine a file’s last access time?(a) fileltime()(b) filectime()(c) fileatime()(d) filetime()I have been asked this question during an online interview.I'm obligated to ask this question of File System and PHP topic in division File and Session Handling in PHP of PHP |
|
Answer» The correct answer is (C) fileatime() |
|
| 89. |
The filesize() function returns the file size in ___________(a) bits(b) bytes(c) kilobytes(d) gigabytesI have been asked this question in an interview.Enquiry is from File System and PHP topic in portion File and Session Handling in PHP of PHP |
|
Answer» The CORRECT option is (b) bytes |
|