Wednesday, 15 October 2014

Hello Everyone...!!!
PHP, technical interview Questions to inprove PHP developers skills, PHP Questions and answers to solve,

This morning i am here with Multiple choice questions of PHP for PHP developers to improve Web Development skills.
        These questions are based on Arrays, Syntax and Uploading files with PHP.

PHP Questions :

 

Questions Based On Arrays :

 

Que.1 What will be the output of the following PHP code?
 
  1. $cars = array("Volvo", "BMW", "Toyota");
  2. echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
  3. ?>
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) .

Que.2 What will be the output of the following PHP code?
 
  1. $fname = array("Peter", "Ben", "Joe");
  2. $age = array("35", "37", "43");
  3. $c = array_combine($fname, $age);
  4. print_r($c);
  5. ?>
a) Array ( Peter Ben Joe )
b) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
c) Array ( 35 37 43 )
d) Array ( “[Peter] => 35″ “[Ben] => 37″ “[Joe] => 43″ )

Que.3 What will be the output of the following PHP code?
 
  1. $a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
  2. $a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");
  3. $result = array_diff($a1, $a2);
  4. print_r($result);
  5. ?>
a) Array ( [d] => yellow )
b) Array ( [c] => blue )
c) Array ( [a] => red )
d) Array ( [e] => yellow )

Que.4 What will be the output of the following PHP code?
 
  1. $a = array("a"=>"red", "b"=>"green", "c"=>"blue");
  2. echo array_shift($a);
  3. print_r ($a);
  4. ?>
a) green
b) red
c) blue
d) none of the above

Que.5 What will be the output of the following PHP code?
 
  1. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  2. print_r(array_change_key_case($age, CASE_UPPER));
  3. ?>
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 )

Questions based on syntax


Que.1 What will be the output of the following PHP code ?
  1. Echo "Hello World1";
  2. echo " Hello world2";
  3. ECHO " Hello world3";
  4. ?>
a) Hello world1 Hello world2 Hello World3
b) Hello world1
Hello world2
Hello World3
c) Error
d) Hello world1 Hello world3

Que.2 What will be the output of the following PHP code ?
  1. $color = "red";
  2. echo "$color";
  3. echo "$COLOR";
  4. echo "$Color";
  5. ?>
a) redredred
b) redred
c) red
d) Error

Que.3 What will be the output of the following PHP code ?
  1.  # echo "Hello world";
  2.  echo "# Hello world"; 
  3. ?>
a) # Hello world
b) Hello world# Hello world
c) Hello world
d) Error
Que.4 What will be the output of the following PHP code ?
  1. echo "Hello World"
  2. ?>
a) Hello world
b) Hello world in italics
c) Nothing
d) Error


Que.5  What will be the output of the following PHP code ?
  1. echo "echo "Hello World"";
  2. ?>
a) Hello world
b) echo “Hello world”
c) echo Hello world
d) Error

Questions based on Uploading files with PHP


Que.1  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?

a) max_take_time
b) max_intake_time
c) max_input_time
d) max_parse_time

Que.2 What is the default value of max_input_time directive?

a) 30 seconds
b) 60 seconds
c) 120 seconds
d) 1 second

Que.3 What is the default value of the directive max_file_limit?

a) 10 files
b) 15 files
c) 20 files
d) 25 files

Que.4 Which directive sets a maximum allowable amount of memory in megabytes that a script can allow?

a) max_size
b) post_max_size
c) max_memory_limit
d) memory_limit

Que.5 How many items are available in the $_FILES array?

a) 2
b) 3
c) 4
d) 5

Answersheet of these Questions will be available Tomorrow
 
Want more Questions....??? CLICK THE LINKS BELOW
 
 

Share your experience or any suggestion with us .. VIA COMMENTS

 


Regards : Mobile Application Development in Indore







0 comments:

Post a Comment

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube