Home
Current Affairs January 2024

What is the correct answer?

4

PHP files have a default file extension of..


A.

.html


B.

.xml


C.

.php


D.

.ph


E.

.asp


F.

.jsp


Correct Answer :

C.

.php



Related Questions

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

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

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

What will be the output of the following PHP code? If say date is 22/06/2013.
     <?php      printf( date(t) )     ?> 

A. 30

B. 22

C. JUNE

D. 2013

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  $color = red;
$color = green;
echo $color;
?>

A. red

B. green

C. red green

D. error

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

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

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

Which directive determines how the session information will be stored?

A.

save_data

B.

session.save

C.

session.save_data

D.

session.save_handler

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $age = array(Peter=>35, Ben=>37, Joe=>43);
print_r(array_change_key_case($age, CASE_UPPER));
?>

A.

Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )

B.

Array ( [peter] => 35 [ben] => 37 [joe] => 43 )

C.

Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )

D.

Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )

What is the correct answer?

4

What will be the output of the following PHP code?
 <?php  $a1 = array(a=>red, b=>green, c=>blue, d=>yellow);
$a2 = array(e=>red, f=>green, g=>blue);
$result = array_diff($a1, $a2);
print_r($result);
?>

A.

Array ( [d] => yellow )

B.

Array ( [c] => blue )

C.

Array ( [a] => red )

D.

Array ( [e] => yellow )

What is the correct answer?

4

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

A. hello

B. infinite loop

C. hihello

D. error

What is the correct answer?

4

What will be the output of the following PHP code ?
 <?php  define('IF', 42);
echo IF: , IF;
?>

A. IF:42

B. No output

C. IF:

D. ERROR

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 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

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  $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)

What is the correct answer?

4

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

A. red

B. green

C. red green

D. redgreen

What is the correct answer?

4

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

A. red1

B. red 1

C. 0

D. 1

What is the correct answer?

4

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

A. PHP is a scripting language

B. __LINE__

C. 2

D. ERROR

What is the correct answer?

4

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

A. red green

B. red

C. green

D. error

What is the correct answer?

4

Which one of the following function is used to start a session?

A.

start_session()

B.

session_start()

C.

session_begin()

D.

begin_session()

What is the correct answer?

4

Which of the following is/are a PHP code editor?
i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT


A.

Only iv)


B.

All of the mentioned.


C.

i), ii) and iii)


D.

Only iii)


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

PHP files have a default file extension of..


A.

.html


B.

.xml


C.

.php


D.

.ph


E.

.asp


F.

.jsp


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  $i = 0;
while ((--$i > ++$i) - 1){ print $i;
} ?>

A. 00000000000000000000….infinitely

B. -1-1-1-1-1-1-1-1-1-1…infinitely

C. no output

D. error

What is the correct answer?

4

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()

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  $color = red;
echo $color . red ;
?>

A. red red

B. red

C. error

D. nothing