Home
Current Affairs January 2024

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)


Correct Answer :

D.

ii), iii) and iv)



To run PHP code you need to have PHP and a web server, both IIS and Apache are web servers.You can choose either one according to your platform.


Related Questions

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

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 will be the output of the following PHP code?
 <?php  $a = array(red, green, blue);
array_pop($a);
print_r($a);
?>

A.

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

B.

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

C.

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

D.

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

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;
print hello;
} ?>

A. 4hello4hello4hello4hello4hello…..infinite

B. 5hello5hello5hello5hello5hello…..infinite

C. no output

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

A. 1234567891011121314….infinitely

B. 01234567891011121314…infinitely

C. 1

D. 0

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

Which function displays the web pages most recent modification date?

A.

lastmod()

B.

getlastmod()

C.

last_mod()

D.

get_last_mod()

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  $color1 = red;
$color2 = red;
echo $color1 + $color2;
?>

A. redgreen

B. red green

C. 0

D. 1

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  $i = ;
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  $color1 = red;
$color2 = 1;
$color3 = greyecho $color1 + $color2 . $color3;
?>

A. 1grey

B. grey

C. 0

D. red1grey

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

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

A. T

B. N

C. E

D. I

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 code? If say date is 22/06/2013.
     <?php      echo Today is .date(F d, Y)     ?> 

A. Today is 22 June, 2013

B. Today is 22-06-2013

C. Today is 06-22-2013

D. Today is June 22, 2013

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

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

A. 54321111111….infinitely

B. 555555555…infinitely

C. 54321

D. 5

What is the correct answer?

4

Which of the following PHP statements will output Hello World on the screen?
i) echo (“Hello World”);
ii) print (“Hello World”);
iii) printf (“Hello World”);
iv) sprintf (“Hello World”);


A.

i) and ii)


B.

i), ii) and iii)


C.

All of the mentioned


D.

i), ii) and iv)


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

A. 1234567891011121314….infinitely

B. 01234567891011121314…infinitely

C. no output

D. error

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

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

A. red red

B. red

C. error

D. nothing

What is the correct answer?

4

What is the default time(in seconds) for which session data is considered valid?

A. 1800

B. 3600

C. 1440

D. 1540