PHP/Current affairs mcq php Sample Test,Sample questions

Question:
A script is a

1.Program or sequence of instructions that is interpreted or carried out by processor directly

2.Program or sequence of instruction that is interpreted or carried out by another program

3.Program or sequence of instruction that is interpreted or carried out by web server only

4.None of above


Question:
A variable $word is set to HELLO WORLD, which of the following script returns in title case?

1.echo ucwords($word)

2.echo ucwords(strtolower($word)

3.echo ucfirst($word)

4.echo ucfirst(strtolower($word)


Question:
Data for a cookie stored in _________ in PHP?

1.In ISP Computer

2.In Users Computer

3.In Server Computer

4.It depends on PHP Coding


Question:
fopen($file_doc,r+&rdquo opens a file for

1.reading

2.writing

3.none of above

4.both of above


Question:
How PHP files can be accessed?

1.Through Web Browser

2.Through HTML files

3.Through Web Server

4.All of Above


Question:
How to define a variable in PHP?

1.$variable_name = value

2.$variable_name = value;

3.$variable_name == value

4.$variable_name as value;


Question:
In mail($param2, $param2, $param3, $param4), the $param2 contains:

1.The message

2.The recipient

3.The header

4.The subject


Question:
In PHP a variable needs to be declare before assign

1.TRUE

2.FALSE

3.Depends on website

4.Depends on server


Question:
In PHP Language variables are case sensitive

1.TRUE

2.FALSE

3.Depends on website

4.Depends on server


Question:
In PHP Language variables name starts with _____

1.! (Exclamation)

2.& (Ampersand)

3.* (Asterisk)

4.$ (Dollar)


Question:
In PHP, each statement must be end with ______

1.(dot)

2.(semicolon)

3.(slash)

4.(colon)


Question:
mysql_connect( ) does not take following parameter

1.database host

2.user ID

3.password

4.database name


Question:
PHP is a widely used ... scripting language that is especially suited  for web development and can be embedded into html

1.Open source general purpose

2.Proprietary general purpose

3.Open source special purpose

4.Proprietary special purpose


Question:
PHP is a ______ typed language.

1.User

2.Loosely

3.Server

4.System


Question:
PHP is _______ scripting language.

1.Server-side

2.Clint-side

3.Middle-side

4.Out-side


Question:
PHP scripts are executed on _________

1.ISP Computer

2.Client Computer

3.Server Computer

4.It depends on PHP scripts


Question:
PHP Scripts starts with ________

1.<php> … </php>

2.<?php … ?>

3.?php … ?php

4.<p> … </p>


Question:
PHP Stands for

1.Php Hypertext Processor

2.Php Hypertext Preprocessor

3.Php Hypermarkup Preprocessor

4.Php Hypermarkup Processor


Question:
The difference between include() and require()

1.are different how they handle failure

2.both are same in every aspects

3.is include() produced a Fatal Error while require results in a Warning

4.none of above


Question:
The function setcookie( ) is used to

1.Enable or disable cookie support

2.Declare cookie variables

3.Store data in cookie variable

4.All of above


Question:
The uses of strcmp( ) function in PHP?

1.It compare strings including case

2.It compare strings excluding case

3.It compare strings only Uppercase

4.It compare strings only lowercase


Question:
To work with remote files in PHP you need to enable

1.allow_url_fopen

2.allow_remote_files

3.both of above

4.none of above


Question:
What does fopen() function do in PHP?

1.It used to open files in PHP

2.It used to open Remote Server

3.It used to open folders in PHP

4.It used to open Remote Computer


Question:
What does isset() function do in PHP?

1.There is no such function in PHP

2.It checks whether variable is set or not

3.It checks whether variable is free or not

4.It checks whether variable is string or integer


Question:
What does sprintf() function do in PHP?

1.it sends output to a variable

2.it prints the output of program

3.it sends output to a variable converting into string

4.it prints the output of program converting into string


Question:
What does the hash (#) sign mean in PHP?

1.It indicates lines that are commented out.

2.It indicates variable declaration.

3.It indicates function declaration.

4.No uses in PHP.


Question:
What does the PHP Interpreter do?

1.It translates User Language to System Language

2.It creates connection between ISP & Server

3.It processes the HTML and PHP files

4.All of these


Question:
What is the use of strlen( ) function in PHP?

1.It returns the type of a string

2.It returns the value of a string

3.It returns the length of a string

4.It returns the subset value of a string


Question:
What is the use of strpos( ) function in PHP?

1.Search for a number within a string

2.Search for a Spaces within a string

3.Search for a character/text within a string

4.Search for a Capitalized string/text with in a string


Question:
What will be the result of combining a string with another data type in PHP?

1.int

2.float

3.string

4.double


Question:
When a file is included the code it contains, behave for variable scope of the line on which the include occurs

1.Any variable available at that line in the calling file will be available within the called file from that point

2.Any variable available at that line in the calling file will not be available within thecalled file

3.Variables are local in both called and calling files

4.None of above


Question:
When compared to the compiled program, scripts run

1.Faster

2.Slower

3.The execution speed is similar

4.All of above


Question:
When uploading a file if the UPLOAD_ERR-OK contains value 0 it means

1.Uplaod is not successful, error occurred

2.The file uploaded with success

3.Uploaded file size is 0

4.File upload progress is 0% completed


Question:
When you need to obtain the ASCII value of a character which of the following function you apply in PHP?

1.chr( );

2.asc( );

3.ord( );

4.val( );


Question:
Where session_start() function must appear in PHP?

1.Anywhere

2.With <html> tag

3.After <html>tag

4.Before <html> tag


Question:
Where setcookie( ) function must appear in PHP?

1.Before tag

2.After tag

3.In tag

4.Anywhere


Question:
Which function displays the information about PHP?

1.info()

2.sysinfo()

3.phpinfo()

4.php_info()


Question:
Which of the following function returns the number of characters in a string variable?

1.count($variable)

2.len($variable)

3.strcount($variable)

4.strlen($variable)


Question:
Which of the following is not a session function?

1.sssion_decode

2.session_destroy

3.session_destroy

4.session_pw


Question:
Which of the following is not PHP Loops?

1.while

2.do while

3.for

4.do for


Question:
Which of the following is not the scope of Variable in PHP?

1.Local

2.Global

3.Static

4.Extern


Question:
Which of the following is not true?

1.PHP can be used to develop web applications.

2.PHP makes a website dynamic.

3.PHP applications can not be compiled.

4.PHP can not be embedded into html.


Question:
Which of the following is the Concatenation Operator in PHP?

1.+ (Plus)

2.. (dot)

3.& (Ampersand)

4.% (Percentage)


Question:
Which of the following is used to add comments in PHP?

1.//

2./* … */

3.& … &

4.Only A & B


Question:
Which of the following method is suitable when you need to send larger form submissions?

1.Get

2.Post

3.Both Get and Post

4.There is no direct way for larger form. You need to store them in a file and retrieve


Question:
Which of the following method sends input to a script via a URL?

1.Get

2.Post

3.Both

4.None


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

1.W

2.W+

3.A

4.A+


Question:
Which of the following statements prints in PHP?

1.Out

2.Write

3.Echo

4.Display


Question:
Which of the following variables is not a predefined variable?

1.$get

2.$ask

3.$request

4.$post


Question:
You can define a constant by using the define() function. Once a constant is defined

1.It can never be changed or undefined

2.It can never be changed but can be undefined

3.It can be changed but can not be undefined

4.It can be changed and can be undefined


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
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website 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!