Explore topic-wise MCQs in Technical Programming.

This section includes 411 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

151.

Which one of the following is the default PHP session name?

A. PHPSESSID
B. PHPSESID
C. PHPSESSIONID
D. PHPIDSESS
Answer» B. PHPSESID
152.

Which directive determines how the session information will be stored?

A. save_data
B. session.save
C. session.save_data
D. session.save_handler
Answer» E.
153.

How many ways can a session data be stored?

A. 3
B. 4
C. 5
D. 6
Answer» C. 5
154.

Which one of the following is the very first task executed by a session enabled page?

A. Delete the previous session
B. Start a new session
C. Check whether a valid session exists
D. Handle the session
Answer» D. Handle the session
155.

Which of the following statements is used to add an attachment to the mail?

A. $mimemail->attachment(‘attachment.pdf’);
B. $mimemail=>attachment(‘attachment.pdf’);
C. $mimemail->addAttachment(‘attachment.pdf’);
D. $mimemail=>addAttachment(‘attachment.pdf’);
Answer» D. $mimemail=>addAttachment(‘attachment.pdf’);
156.

How many configuration directives pertinent to PHP’s mail function are available?

A. 4
B. 5
C. 6
D. 7
Answer» C. 6
157.

Which one of the following function is used to send an email using PHP script?

A. mail_send()
B. send_mail()
C. mailrr()
D. mail()
Answer» E.
158.

Which one of the following statements can be used to establish port 80 connection with www.nachi.com?

A. fsockopen(“www.nachi.com”, 80);
B. sockopen(80,”www.nachi.com”);
C. fsockopen(80,”www.nachi.com”);
D. sockopen(“www.nachi.com”, 80);
Answer» B. sockopen(80,”www.nachi.com”);
159.

Which one of the following function returns the port number of a specified service?

A. getportname()
B. getservername()
C. getserverbyname()
D. getservbyname()
Answer» E.
160.

What is the default port number of HTTPs?

A. 70
B. 80
C. 90
D. 100
Answer» C. 90
161.

Which one of the following function is used to retrieve the MX records for the domain specified by hostname?

A. getmx()
B. retrieve_mx()
C. getmxrr()
D. retrieve_mxrr()
Answer» D. retrieve_mxrr()
162.

Which one of the following function is used to return an array consisting of various DNS resource records pertinent to a specific domain?

A. dns_get_record()
B. dns_record()
C. dnsrr_get_record()
D. dnsrr_record()
Answer» B. dns_record()
163.

Which one of the following function checks for the existence of DNS records?

A. checkdns()
B. checkdnsr()
C. checkdnsrr()
D. checkdnsa()
Answer» D. checkdnsa()
164.

What is the full form of DNS?

A. Digital Network System
B. Domain Network System
C. Digital Name Systmem
D. Domain Name System
Answer» E.
165.

Which function is used to determine whether a file was uploaded?

A. is_file_uploaded()
B. is_uploaded_file()
C. file_uploaded(“filename”)
D. uploaded_file(“filename”)
Answer» C. file_uploaded(“filename”)
166.

How many items are available in the $_FILES array?

A. 2
B. 3
C. 4
D. 5
Answer» E.
167.

Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?

A. $_FILE Array
B. $_FILEs Array
C. $_FILES_UPLOADED Array
D. $_FILE_UPLOADED Array
Answer» C. $_FILES_UPLOADED Array
168.

If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?

A. upload_tmp_dir “/tmp/phpuploads/ directory”
B. upload_dir “/tmp/phpuploads/ directory”
C. upload_temp_dir “/tmp/phpuploads/ directory”
D. upload_temp_director “/tmp/phpuploads/ directory”
Answer» B. upload_dir “/tmp/phpuploads/ directory”
169.

Which directive sets a maximum allowable amount of memory in megabytes that a script can allow?

A. max_size
B. post_max_size
C. max_memory_limit
D. memory_limit
Answer» E.
170.

What is the default value of the directive max_file_limit?

A. 10 files
B. 15 files
C. 20 files
D. 25 files
Answer» D. 25 files
171.

Since which version of PHP was the directive max_file_limit available.

A. PHP 5.2.1
B. PHP 5.2.2
C. PHP 5.2.12
D. PHP 5.2.21
Answer» D. PHP 5.2.21
172.

What is the default value of max_input_time directive?

A. 30 seconds
B. 60 seconds
C. 120 seconds
D. 1 second
Answer» C. 120 seconds
173.

Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?

A. max_take_time
B. max_intake_time
C. max_input_time
D. max_parse_time
Answer» D. max_parse_time
174.

Which directive determines whether PHP scripts on the server can accept file uploads?

A. file_uploads
B. file_upload
C. file_input
D. file_intake
Answer» B. file_upload
175.

Which is the most powerful authentication method among the four?

A. Hard-coding a login pair directly into the script
B. File-based authentication
C. Data-based authentication
D. PEAR’S HTTP authentication
Answer» D. PEAR’S HTTP authentication
176.

In which of the following situations does file-based authentication become inconvenient. i) small list ii) large number of user iii) users are being regularly added iv) static authentication

A. i) and iv)
B. i) and iii)
C. ii) and iii)
D. ii) and iv)
Answer» D. ii) and iv)
177.

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()
Answer» D. md5()
178.

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 mentioned
Answer» C. Within
179.

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 login pair directly into the script
B. File-based authentication
C. Data-based authentication
D. PEAR’S HTTP authentication
Answer» B. File-based authentication
180.

Which of the following are types of PHP authentication implementation methodologies? i) Hard-coding a login pair directly into the script ii) File-based authentication iii) Data-based authentication iv) PEAR’S HTTP authentication

A. ii) and iii)
B. i) and iv)
C. ii), iii) and iv)
D. All of the mentioned
Answer» E.
181.

Which function is used to verify whether a variable contains a value?

A. header()
B. footer()
C. inset()
D. isset()
Answer» E.
182.

Which of the following PHP function is commonly used when handling authentication via PHP? i) header() ii) footer() iii) inset() iv) isset()

A. i) and iv)
B. ii) and iv)
C. ii) and iii)
D. i) and iii)
Answer» B. ii) and iv)
183.

Which of the following variables does PHP use to authenticate a user? i) $_SERVER[‘PHP_AUTH_USER’]. ii) $_SERVER[‘PHP_AUTH_USERS’]. iii) $_SERVER[‘PHP_AUTH_PU’]. iv) $_SERVER[‘PHP_AUTH_PW’].

A. i) and ii)
B. ii) and iv)
C. i) and iv)
D. ii) and iii)
Answer» D. ii) and iii)
184.

How many predefined variables does PHP use to authenticate a user?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
185.

How many validation filters like FILTER_VALIDATE_EMAIL are currently available?

A. 5
B. 6
C. 7
D. 8
Answer» D. 8
186.

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_MAIL
Answer» B. FILTER_VALIDATE_MAIL
187.

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()
Answer» C. tags_strip()
188.

Which one of the following should not be used while sending passwords or other sensitive information?

A. GET
B. POST
C. REQUEST
D. NEXT
Answer» B. POST
189.

Which variable is used to collect form data sent with both the GET and POST methods?

A. $BOTH
B. $_BOTH
C. $REQUEST
D. $_REQUEST
Answer» E.
190.

When you use the $_POST variable to collect data, the data is visible to..

A. none
B. only you
C. everyone
D. selected few
Answer» C. everyone
191.

When you use the $_GET variable to collect data, the data is visible to..

A. none
B. only you
C. everyone
D. selected few
Answer» D. selected few
192.

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. scripting
Answer» D. scripting
193.

Which two predefined variables are used to retrieve information from forms?

A. $GET & $SET
B. $_GET & $_SET
C. $__GET & $__SET
D. GET & SET
Answer» C. $__GET & $__SET
194.

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()
Answer» C. ISODate()
195.

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’);
Answer» B. $date = modify(‘+2 months’);
196.

Among the four PHP DateTimeZone classes given below how many are non static? i) _construct() ii) getName() iii) getOffset() iv) getTransitions()

A. 1
B. 2
C. 3
D. 4
Answer» E.
197.

Among the four PHP DateTimeZone classes given below how many are static? i) listAbbreviations() ii) getName() iii) getOffset() iv) listIdentifiers()

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
198.

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’);
Answer» C. date_set_default_timezone(‘Europe/London’);
199.

Which method is simply an object-oriented version of date()?

A. DateTime::format()
B. DateTime::modify()
C. DateTime::setTime()
D. DateTime::setDate()
Answer» B. DateTime::modify()
200.

How many constants does the DateTime class have?

A. 8
B. 9
C. 10
D. 11
Answer» C. 10