PHP Multiple Type (MCQ) Objective Interview Questions

PHP is the most popular web programming language. It’s Open-Source and easy to learn. If you are learning PHP, check some video tutorials. The objective questions in this MCQ is of basic type some output questions, questions related to arrays etc.

PHP Multiple Choice Objective (MCQ) Interview Questions

Congratulations - you have completed PHP Multiple Choice Objective (MCQ) Interview Questions. You scored %%SCORE%% out of %%TOTAL%%. Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1
PHP is a ____ scripting language.
A
Server Side
B
Client Side
C
None of the above
D
Both a and b is correct
Question 1 Explanation: 
PHP is a server side scripting language.
Question 2
Choose the correct declaration of variable in PHP
A
var a = 10;
B
$a=10;
C
int a;
D
None of the above
Question 2 Explanation: 
Variables in PHP are represented by a dollar sign followed by the name of the variable.
Question 3
What in_array() function does in PHP ?
A
Check whether array is declared
B
Checks if a value exists in an array
C
Both a and b
D
None of them
Question 3 Explanation: 
in_array() function checks if value exists in an array. For reference check in_array example
Question 4
What's the output of this code
$a = 10;
unset($a);

echo $a;
A
10
B
0
C
No value is returned
D
All of the above
Question 4 Explanation: 
Unset destroy the variable. So when we echo $a nothing is returned.
Question 5
What's the output of the following code.
$a = 10;

if(isset($a)){

echo "variable is declared";

}else{

echo "variable is not declared";

}
A
variable is not declared
B
Error
C
variable is declared
D
NULL
Question 5 Explanation: 
isset() function checks whether variable is declared and it is not null.
Question 6
  $str = "world";

  echo "hello".$str;
It gives following output.
A
helloworld
B
hello world
C
Error
D
hello$str
Question 6 Explanation: 
dot(.) operator is used to concatenate two values.
Question 7
if('8'==8){

      echo "True";
  }else{
      echo "False";
  }
Following code prints.
A
False
B
True
C
None
D
Not Valid
Question 7 Explanation: 
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 7 questions to complete.

Tagged , , . Bookmark the permalink.

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.