PHP QUIZ
1 .
Which one of these variables has an illegal name?

Correct Answer : Option (B)

$my-Var
  Show Answer
2 .
What will be printed?
<?php
   $var = 'a';
   $VAR = 'b';
  echo "$var$VAR";
?>​

Correct Answer : Option (D)

ab
  Show Answer
3 .
Which of following are compound data type?

Correct Answer : Option (C)

Both 
  Show Answer
4 .
Which of the following method acts as a constructor function in a PHP class ?

Correct Answer : Option (A)

__construct
  Show Answer
5 .
How do you create an array in PHP?

Correct Answer : Option (D)

$cars = array("Volvo", "BMW", "Toyota");
  Show Answer
6 .
How do we access the value of 'd' later?
$a = array(
    'a',
    3 => 'b',
    1 => 'c',
    'd'
 );​

Correct Answer : Option (C)

$a[4]
  Show Answer
7 .
What will be printed?
<?php
   $a = array(
	  null => 'a',
	  true => 'b',
	  false => 'c',
	  0 => 'd',
	  1 => 'e',
	  '' => 'f'
	);
  echo count($a), "\n";
?>​

Correct Answer : Option (A)

3
  Show Answer
8 .
What will be the output of the following PHP code?
<?php
    define("Hi","Hello! How are you ?");
    echo constant("Hi");
?>​

Correct Answer : Option (B)

Hello! How are you ?
  Show Answer
9 .
Which in-built function will add a value to the end of an array ?

Correct Answer : Option (D)

array_push()
  Show Answer
10 .
Which two predefined variables are used to retrieve information from forms ?

Correct Answer : Option (B)

$_GET & $_SET
  Show Answer