Site Loader
Get a Quote

MCQ Question

MCQ Question Php:-Hi Readers, In this blog, I will provide you most frequently asked interview question on PHP with an answer.I have already provided some question on PHP in the previous blog also.

MCQ Question Php

Here are some most asked MCQ Question Php:- 

Q1 what is the latest version of php language ?

A1- Latest Version of php language is PHP 7.0.2

Q2-How to write a string ‘Mcq’s question ‘ in php language?

A2-In php language,

<?php $string=’Mcq’s question’ ;   echo $string; ?>

Q3-How to unset a session variable in php?

A3- unset ($_SESSION[‘varname’]);

Q4-How to convert string variable to int in php language?

-$string = ‘400’; $int = (int)$string;

Q5-How to check variable is string or not ?

A5-To check string variable type we use is_string($parameter) function.

Q6-How to define function in php language?

function Mcqs()
echo ‘Mcq’s Question on php’;



Q7-How to define function with parameter in php language?


function Mcqs($param1,$param2,etc….)
echo ‘Mcq’s Question on php’;



Q8-How to disclose a active connection in php?





Q9-Official website of Php language ?


Q10-How to make connection in php language?


 <?php  $conncetionlink = mysql_connect('localhost', 'mysql_user', 'mysql_password');  if (!$conncetionlink ) {     die('connection not established: ' . mysql_error());  } 
echo 'Congrtats ! Connected successfully';
 mysql_close($conncetionlink );  ?> 

Q11- How can we determine php variable is empty or not?

A11-To determine php variable is empty.we use

<?php $variable = 0; // Evaluates to true because $var is empty if (empty($variable))  {   
echo 'php function to check $variable is either 0, empty, or not set at all';  }  ?> 

Q12-To determine a php variable is SET or NOT then we use which function of php?

A12- We can determine a php variable is set or not by using following code.

$setvariable = '';

// This will evaluate to TRUE so
 the text will be printed.
if (isset($setvariable)) {
    echo "This variable  is set so 
I will print in this code.";
} ?>


I hope you enjoyed this post about “MCQ’s Question Php” and provide your valuable feedback and share your problem in Technical Forum.

Post Author: TechieFlair

Leave a Reply

Your email address will not be published.