Find the basic/advance core PHP developer Interview Questions with Answers for fresher & experienced here, Which are generally asked in technical interview by best or top IT companies. 

We have added some of basic questions also for beginners or freshers.And freshers can also check  PHP TUTORIAL FOR BEGINEER  before reading technical PHP developer questions and answers. PHP programming language is a big player of web life.So if you want to make your career as WEB Developer then you should know basic of PHP anyhow. For all interviewer please read all below questions before attending interview.

-:PHP INTERVIEW QUESTIONS WITH ANSWERS :-

1)  What is PHP?

a>PHP is one of the most Web Development programming languages.
b>PHP is also known as server side scripting language that allows developers to create dynamic web pages.
c>PHP is Open Source.It is also an object oriented programming language like java.

2)  What does the initials of PHP stand for?

PHP stand for “PHP Hypertext Preprocessor”.

3)  What is the use of “echo” in php?

Echo is a statement used to display result on screen. It can be used with parentheses or without parentheses.

Example of PHP echo statement:-

Output for above script:- 

Car insurance

4)  What does PEAR stands for?

a>PEAR stands for  “PHP Extension and Application Repository”.
b>It extends PHP script and provides a higher level of programming for web developers.It support for code distribution and package maintenance.

5)  Does PHP language support multiple inheritance or not ?

No, PHP does not support multiple inheritance.It only support single inheritance by use of ‘extend‘ ,Means one class can only extend one class at a time.




6)  How to include a file in PHP file or page?

We can include a file by using “include() ” or “require()” PHP function with file path as its parameter.

For example:- (Suppose we want to include a test.php file then we use below code)

7)  How to define a constant in PHP language?

We use Define() function to define constant in PHP Language or script.

For example:

Define(‘MAX’,30);

8)  What are the different types of error in PHP language ?

Notice error: This is small and non critical error – For example: accessing a variable ,which is not defined.
Warning error :Warning errors are more serious errors – For example:Trying to include() a file which  does not exist.
Fatal error : Fatal errors are critical errors – For example: Instantiating an object of a non-existent class, or calling a non-existent function.

9)  Difference between the implode() and explode() function ?

Impload() function : The implode function is used to join elements of array with a string.

For example:-

Output for above script:

W-E-B-S-N-U-B-E

Explode() function : it basically breaks a string into an array.The explode function is used to split a string into pieces by a specified string and convert to array.

FOR EXAMPLE:-

OUTPUT of above script:-
Array(
[0] => WEBS
[1] => NUBE
)

10)  How will you concatenate two string in PHP ?

For concatenating two or more string , we use the dot (.) operator.

For example:-

Output of above script will be:

WebsNube

 

11)  What is MVC in PHP ?

MVC stands for Model, View and Controller. MVC is architecture of any framework in PHP.
Model: The Model is the part of the MVC application that handles the logic for the application data.
View :The View is the parts of the application that handles the display of the data.
Controller :The Controller is the part of the application that handles user interaction.

12)  Difference between the require() and include() function in PHP ?

require function: If the file is not found by require() function, it will cause a fatal error and halt the execution of the script.

include function: If the file is not found by include() function, a warning will be issued, but execution will continue.

13)  What are the magic functions present in PHP ?

Magic functions are in PHP:

__construc,  __get,  __destruct,  __call,  __sleep,  __clone,  __toString,  __set.

14)  What is Session in Web development or PHP ?

A PHP session is variable ,which is used to store information about, or change settings for a user  session.

15)  What is Cookies in Web development or PHP ?

 A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user’s computer.

16)  Difference between the Session and Cookies in PHP or web development ?

 Difference between a session and a cookie is that:

Session data is stored on the server,whereas Cookies store data in the visitor’s browser.

17)  How to create or set a Cookie in PHP  ?

The setcookie() function is used to set a cookie.

Syntax:

setcookie(name, value, expire, path, domain);

For Example: –

In the example below, we will create a cookie named “user” and assign the value “WebsNube” to it.We also specify that the cookie should expire after one hour:

18)  How to Retrieve a Cookie Value in PHP  ?

The PHP $_COOKIE variable is used to retrieve a cookie value.

For Example:

In the example below, we retrieve the value of the cookie named “user” and display it on a page.

19)  What is difference the between POST and GET http request method ?

Difference are :

a>POST is more secure than GET because Your information will be hide during performing of POST operation.

b>GET has limitation You can only pass 255 character query string BUT in POST there is no limitation.




20)  How to use GLOBAL Variable in PHP ?

GLOBAL variable can be accessed in any part of the program.

For example:-

Below by declaring $a and $b global within the function, both variable will refer to the global version.

Output of above script :-

100

21)  How can we get ‘ second ‘of the current time using date function ?

We use date() method to get second of current date:

For example: 

22)  What is the default page in web server of PHP ?

In any PHP Web Server,  Index page is the default page in most of the time.

23)  What is the rand() function in PHP ?

rand() function is used to generate random number.

24)  What is the strlen() function in PHP ?

strlen() function is used to get or find the string length.

25)  What is the isset() function in PHP ?

isset() function is used to check whether variable is set or not with value.

26)  What is the difference between $$var and $var ?

$var represents a variable only.

But $$var represents a variable with the content of $var .

Example:

Output:

hello websnube

27)  How to delete file from system directory in PHP ?

unlink() is a function which used to delete file from system directory in PHP.

28)  What are the super Global variables present in PHP ?

$_GET, $_POST, $_REQUEST, $COOKIE and $SESSION are Super Global variable in PHP.

29)  What is php.ini file and use of this php.ini in PHP ?

The php.ini file is the default configuration file for applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits.

30)  Is PHP case sensitive language or not ?

Yes,  PHP is case sensitive language.Because $var and $vAr both are different variable.

31)  How can we get the browser properties by using PHP ?

By using below PHP Variable we can get browser properties:

  $_SERVER[‘HTTP_USER_AGENT’]

32)  How to register the variables into a session in PHP ?

We can easily register the variable into session by below example:

$_SESSION[‘app_name’] = “facebook”;

33)  What is maximum size of file upload in PHP language ?

In PHP Maximum file upload size is 2MB

34)  How to change the maximum file upload size in PHP language ?

Maximum file upload size can be changed by modifying php.ini file (Default php config file of php).

Below changes required:

you have to search upload_max_filesize in php.ini and replace 2M to 10M (10 MB).

 

Other important questions are coming soooon….please visit always this post to get latest IT company Interview questions

php interview questions and answers for freshers and experience

Top Searches :

  • Php interview questions and answers for experienced,
  • Php interview questions and answers for freshers,
  • Php interview questions and answers for freshers pdf & ppt,
  • Top php interview questions and answers,
  • Php tutorial for fresher and experienced ,
  • Core php interview questions for fresher ,
  • Php developer interview questions for experienced ,
  • Web developer interview questions ,
  • Php and mysql interview questions,
  • Php advanced interview questions,
  • php technical interview questions pdf
  • Php programming interview questions

 

You can see our PHP Tutorial for fresher and experience developer: 

<<<<< PHP tutorial for beginner Day 4 –  Echo and Print operation in PHP

<<<<< PHP tutorial for beginner Day 3 –  variable scope and type of variable

<<<<< PHP tutorial for beginner Day 2 – Syntax overview and tag

<<<<< PHP tutorial for beginner Day 1 – Introduction and Installation.