Php 1000$ job Interview Most Asked questions & answers Revealed

Php developer interview questions and answers for experienced

 

Today I’m sharing  questions that were asked to me  in php developer job vacancy & I successfully got 1000$ job

Php developer interview questions and answers for experienced

# Why PHP is a widely-used?

PHP is a widely-used because there is no cost to download PHP compared to many other languages like Microsoft’s ASP where you are charged for usage .

 

#whats PHP fullform

PHP fullform is Hypertext Preprocessor

 

#Tell me why we use IF ELSE in PHP with example

IF ELSE is used when user enters particular input  then IF answers matches with users input it gives output already defined & else will give by default output as shown below

$favoriteFruit = “APPLE”;
if ( $favoriteFruit == “”APPLE” )
{
echo “Your favorite fruit contains around 7% fibre.”;
}

 

#Why programmer prefer PHP ?

PHP can make many dynamic pages

It can create lot of customisation as per clients requirement

PHP can add, delete, modify data in your database

It can create, open, read, write, and close files on the server

PHP can run on multiple operating system such as Windows, Linux, Unix, Mac OS X, etc.

 

 

#What is the default file extension for PHP files & syntax

The default file extension for PHP files is .php

PHP syntax is as below

<?php
echo “Hello World!”;
?>

 

 

#What are two ways to right Comments in PHP

 

There are two ways to right Comments in PHP

1.Single line

//This is a PHP comment line

 

2.Multi line

 

/*
This is
a PHP comment

*/
?>

 

#Show me how you will subtratct 5,6 numbers in php code

We have to store numbers in variables so i put  5,6 numbers in

$x=5;
$y=6;

In 3rd  variable  $z=$x-$y  i reference $x,$y and finally i use echo $z to display output

<?php
$x=5;
$y=6;
$z=$x-$y;
echo $z;
?>

 

 

#Show me how you will add 5,6 numbers in php code

We have to store numbers in variables so i put  5,6 numbers in

$x=5;
$y=6;

In 3rd  variable  $z=$x+$y  i reference $x,$y and finally i use echo $z to display output

<?php
$x=5;
$y=6;
$z=$x+$y;
echo $z;
?>

 

#Show me how you will find modulus of  5,6 numbers in php code

We have to store numbers in variables so i put  5,6 numbers in

$x=5;
$y=6;

In 3rd  variable  $z=$x%$y  i reference $x,$y and finally i use echo $z to display output

<?php
$x=5;
$y=6;
$z=$x%$y;
echo $z;
?>

 

#Show me how you will Divide 5,6 numbers in php code

We have to store numbers in variables so i put  5,6 numbers in

$x=5;
$y=6;

In 3rd  variable  $z=$x/$y  i reference $x,$y and finally i use echo $z to display output

<?php
$x=5;
$y=6;
$z=$x/$y;
echo $z;
?>

 

You might also like