Home
Current Affairs January 2024

What is the correct answer?

4

Which directive determines how the session information will be stored?

A.

save_data

B.

session.save

C.

session.save_data

D.

session.save_handler

Correct Answer :

D.

session.save_handler


Its prototype follows: session.save_handler = files|mm|sqlite|user.

Related Questions

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $i = 5;
while (--$i > 0 && ++$i){ print $i;
} ?>

A. 5

B. 555555555…infinitely

C. 54321

D. error

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $a1 = array(red, green);
$a2 = array(blue, yellow);
print_r(array_merge($a1, $a2));
?>

A.

Array ( [0] => red [1] => green)

B.

Array ( [0] => blue [1] => yellow [2] => red [3] => green )

C.

Array ( [0] => red [1] => green [2] => blue [3] => yellow )

D.

Array ( [0] => blue [1] => yellow )

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define('GOOD_OCTAL', 0700);
define('BAD_OCTAL', 0600);
print GOOD_OCTAL;
print '
';
print BAD_OCTAL;
?>

A. 448
384

B. 0700
0800

C. ERROR

D. No output

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = red;
echo $color1 + $color2;
?>

A. redgreen

B. red green

C. 0

D. 1

What is the correct answer?

4

Which of following variables can be assigned a value to it?
i) $3hello
ii) $_hello
iii) $this
iv) $This


A.

All of the mentioned


B.

Only ii)


C.

ii), iii) and iv)


D.

ii) and iv)


What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  /*echo Hello world;
*/ ?>

A. Hello world

B. Nothing

C. Error

D.

/* Hello world */

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $i = ;
while ($i = 10){ print hi;
}print hello;
?>

A. hello

B. infinite loop

C. hihello

D. error

What is the correct answer?

4

Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS


A.

All of the mentioned.


B.

Only ii)


C.

ii) and iii)


D.

ii), iii) and iv)


What is the correct answer?

4

Neglecting to set which of the following cookie will result in the cookies domain being set to the host name of the server which generated it.

A.

session.domain

B.

session.path

C.

session.cookie_path

D.

session.cookie_domain

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define(GREETING, PHP is a scripting language);
echo $GREETING;
?>

A. $GREETING

B. no output

C. PHP is a scripting language

D. GREETING

What is the correct answer?

4

What does PHP stand for?


i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page


A.

Both i) and iii)


B.

Both ii) and iv)


C.

Only ii)


D.

Both i) and ii)


What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  class myObject { }define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;
?>

A. test

B. error

C. myObject::CONSTANT

D. no output

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $cars = array(Volvo, BMW, Toyota);
echo I like . $cars[0] . , . $cars[1] . and . $cars[2] . .;
?>

A. I like Volvo BMW and Toyota.

B. I like Volvo, BMW and Toyota)

C. I like Volvo, BMW and Toyota.

D. I like. Volvo.,. BMW. and. Toyota)

What is the correct answer?

4

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

A. Integer

B. String

C. Boolean

D. Float

What is the correct answer?

4

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

A. PHPSESSID

B. PHPSESID

C. PHPSESSIONID

D. PHPIDSESS

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define(GREETING, PHP is a scripting language, true);
echo GREETING;
echo
echo GREETING;
?>

A. PHP is a scripting language

B. GREETING
GREEtING

C. GREETING

D. PHP is a scripting language
PHP is a scripting language

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $color1 = red;
$color2 = 1;
$color3 = greyecho $color1 + $color2 . $color3;
?>

A. 1grey

B. grey

C. 0

D. red1grey

What is the correct answer?

4

A PHP script should start with ___ and end with ___:


A.

< php >


B.

< ? php ?>


C.

<?php ?>


D.

<% %>


What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $i = 2;
while (++$i){ while (--$i > 0) print $i;
} ?>

A. 210

B. 10

C. no output

D. infinite loop

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $cars = array(Volvo, BMW, Toyota, Honda, Mercedes, Opel);
print_r(array_chunk($cars, 2));
?>

A.

Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )

B.

Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )

C.

Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )

D.

Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )

What is the correct answer?

4

How many ways can a session data be stored?

A. 3

B. 4

C. 5

D. 6

What is the correct answer?

4

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

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $color1 = 1;
$color2 = 1;
echo $color1 + $color2;
?>

A. 11

B. 2

C. 0

D. 1

What is the correct answer?

4

If session.use_cookie is set to 0, this results in use of..

A. Session

B. Cookie

C. URL rewriting

D. Nothing happens

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $a = array(a=>red, b=>green, c=>blue);
echo array_shift($a);
print_r ($a);
?>

A.

green

B.

red

C.

redArray( [c] => green [c] => blue )

D.

redArray( [b] => green [c] => blue )

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  class Constants{    define('MIN_VALUE', '0.0');
define('MAX_VALUE', '1.0');
public static function getMinValue() { return self::MIN_VALUE;
} public static function getMaxValue() { return self::MAX_VALUE;
}}echo Constants::getMinValue();
echo Constants::getMaxValue();
?>

A. 0.01.0

B. 01

C. No output

D. ERROR

What is the correct answer?

4

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 zeros

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define('GREETING_TEST', 'PHP is a scripting language', true);
echo GREETING_TESt;
$changing_variable = 'test';
echo constant('GREETING_' . strtoupper($changing_variable));
?>

A. PHP is a scripting language
PHP is a scripting language

B. GREETING_TESt

C. PHP is a scripting language

D. PHP is a scripting language
GREETING_TEST

What is the correct answer?

4

What is the default number of seconds that cached session pages are made available before the new pages are created?

A. 360

B. 180

C. 3600

D. 1800

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $a = array(A, Cat, Dog, A, Dog);
print_r(array_count_values($a));
?>

A.

Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )

B.

Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )

C.

Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )

D.

Array ( [A] => 2 [Cat] => 1 [Dog] => 1)