PHP/PHP Mcq Set 2 Sample Test,Sample questions

Question:
How many constants does the DateTime class have?

1.8

2.9

3.10

4.11


Question:
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.

1.7

2.8

3.9

4.10


Question:
How many methods does the DateTime class have?

1.8

2.9

3.10

4.11


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

1.1

2.2

3.3

4.4


Question:
How many validation filters like FILTER_VALIDATE_EMAIL are currently available?

1.5

2.6

3.7

4.8


Question:
If the format is F then which one of the following will be returned?

1.Complete text representation of month

2.Day of month, with leading zero

3.Daylight saving time

4.Day of month, without zeros


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

1.upload_tmp_dir “/tmp/phpuploads/ directory”

2.upload_dir “/tmp/phpuploads/ directory

3.upload_temp_dir “/tmp/phpuploads/ directory”

4.upload_temp_director “/tmp/phpuploads/ directory”


Question:
In which authentication method does changing the username or password can be done only by entering the code and making the manual adjustment.

1.Hard-coding a login pair directly into the script

2.File-based authentication

3.Data-based authentication

4.PEAR’S HTTP authentication


Question:
Since which version of PHP was the directive max_file_limit available.

1.PHP 5.2.1

2.PHP 5.2.2

3.PHP 5.2.12

4.PHP 5.2.21


Question:
Suppose you want to calculate the date 45 days from the present date which one of the following statement will you use?

1.totime(“+45”)

2.totime(“+45 days”)

3.strtotime(“+45 days”)

4.strtotime(“-45 days”)


Question:
The attack which involves the insertion of malicious code into a page frequented by other users is known as _____________

1.basic sql injection

2.advanced sql injection

3.cross-site scripting

4.scripting


Question:
The authenticationFile.txt, the file which stores username and password should be stored ___ the server document root.

1.Inside

2.Outside

3.Within

4.None of the mentioned


Question:
The date() function returns ___ representation of the current date and/or time.

1.Integer

2.String

3.Boolean

4.Float


Question:
The filesize() function returns the file size in ___________

1.bits

2.bytes

3.kilobytes

4.gigabytes


Question:
To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?

1.$date = Date(“22 JUNE 2013”)

2.$date = new Date(“JUNE 22 2013”)

3.$date = DateTime(“22 JUNE 2013”)

4.$date = new DateTime(“22 JUNE 2013”)


Question:
To validate an email address, which flag is to be passed to the function filter_var()?

1.FILTER_VALIDATE_EMAIL

2.FILTER_VALIDATE_MAIL

3.VALIDATE_EMAIL

4.VALIDATE_MAIL


Question:
What is the default value of max_input_time directive?

1.30 seconds

2.60 seconds

3.120 seconds

4.1 second


Question:
What is the default value of the directive max_file_limit?

1.10 files

2.15 files

3.20 files

4.25 files


Question:
When you use the $_GET variable to collect data, the data is visible to ______

1.none

2.only you

3.everyone

4.selected few


Question:
When you use the $_POST variable to collect data, the data is visible to _____

1.none

2.only you

3.everyone

4.selected few


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

1.file_uploads

2.file_upload

3.file_input

4.file_intake


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

1.max_size

2.post_max_size

3.max_memory_limit

4.memory_limit


Question:
Which function displays the web page’s most recent modification date?

1.lastmod()

2.getlastmod()

3.last_mod()

4.get_last_mod()


Question:
Which function is used to remove all HTML tags from a string passed to a form?

1.remove_tags()

2.strip_tags()

3.tags_strip()


Question:
Which function is used to split a string into a series of substrings, with each string boundary is determined by a specific separator?

1.break()

2.divide()

3.explode()

4.md5()


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

1.header()

2.footer()

3.inset()

4.isset()


Question:
Which function is useful when you want to output the executed command result?

1.out_cmm()

2.out_system()

3.cmm()

4.system()


Question:
Which function sets the file filename last-modified and last-accessed times?

1.sets()

2.set()

3.touch()

4.touched()


Question:
Which is the most powerful authentication method among the four?

1.Hard-coding a login pair directly into the script

2.File-based authentication

3.Data-based authentication

4.PEAR’S HTTP authentication


Question:
Which method enables you to calculate whether daylight saving time is in force at a specific date and time?

1.getOffset()

2.getTranitions()

3.ISODate()

4.savingTime()


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

1.DateTime::format()

2.DateTime::modify()

3.DateTime::setTime()

4.DateTime::setDate()


Question:
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?

1.max_take_time

2.max_intake_time

3.max_input_time

4.max_parse_time


Question:
Which of the following is the right way to use the DateTime class?

1.$date = get_Class(DateTime);

2.$date = class DateTime;

3.$date = new DateTime();

4.$date = new class DateTime();


Question:
Which of the following statements can be used to add two months to the existing date?

1.$date->modify(‘+2 months’);

2.$date = modify(‘+2 months’);

3.$date = modify(‘2+ months’);

4.$date->modify(‘2+ months’);


Question:
Which of the following statements can be used to set the time zone in individual scripts?

1.date_set_timezone(‘Europe/London’);

2.date_default_timezone_set(‘Europe/London’);

3.date_set_default_timezone(‘Europe/London’);

4.date_default_timezone(‘Europe/London’);


Question:
Which one of the following format parameter can be used to identify timezone?

1.T

2.N

3.E

4.I


Question:
Which one of the following function is capable of reading a file into a string variable?

1.file_contents()

2.file_get_contents()

3.file_content()

4.file_get_content()


Question:
Which one of the following function is capable of reading a file into an array?

1.file()

2.arrfile()

3.arr_file()

4.file_arr()


Question:
Which one of the following function is capable of reading a specific number of characters from a file?

1.fgets()

2.fget()

3.fileget()

4.filegets()


Question:
Which one of the following function is useful for producing a timestamp based on a given date and time?

1.time()

2.mktime()

3.mrtime()

4.mtime()


Question:
Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?

1.fgetsh()

2.fgetsp()

3.fgetsa()

4.fgetss()


Question:
Which one of the following function outputs the contents of a string variable to the specified resource?

1.filewrite()

2.fwrite()

3.filewrites()

4.fwrites()


Question:
Which one of the following function reads a directory into an Array?

1.scandir()

2.readdir()

3.scandirectory()

4.readdirectory()


Question:
Which one of the following functions can be used to concatenate array elements to form a single delimited string?

1.explode()

2.implode()

3.concat()

4.concatenate()


Question:
Which one of the following functions finds the last occurrence of a string, returning its numerical position?

1.strlastpos()

2.strpos()

3.strlast()

4.strrpos()


Question:
Which one of the following functions will convert a string to all uppercase?

1.strtoupper()

2.uppercase()

3.str_uppercase()

4.struppercase()


Question:
Which one of the following PHP function is used to determine a file’s last access time?

1.fileltime()

2.filectime()

3.fileatime()

4.filetime()


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

1.GET

2.POST

3.REQUEST


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

1.$GET & $SET

2.$_GET & $_SET

3.$__GET & $__SET

4.GET & SET


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

1.$BOTH

2.$_BOTH

3.$REQUEST

4.$_REQUEST


More MCQS

  1. PHP Mcq Set 1
  2. PHP Mcq Set 2
  3. PHP Mcq Set 3
  4. PHP Mcq Set 4
  5. Current affairs mcq php
  6. Current affairs mcq php set 2
  7. Current affairs mcq php set 3
  8. PHP MCQ
  9. PHP MCQ Basics
  10. PHP Mcq Functions
  11. PHP Mcq Arrays
  12. PHP Mcq Basics of Object-Oriented PHP
  13. PHP Mcq Error Handling
  14. PHP Basics Mcq Questions
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!