PHP Interview Questions

Core PHP Interview Questions

  • Tony Thomas
  • 31st Dec, 2020

About PHP

PHP stands for Hypertext Preprocessor is a server-side scripting language. PHP is among one of the most popular programming languages on the World Wide Web. This server-side programming language is highly flexible and loaded with many innovative features to create Dynamic websites. With PHP, you can simply build a website that is interactive for visitors to your site. There are many people that are programmers that can create PHP forms for their website without a generator, but not everyone can do that. Some of the best examples of websites that are actually written in PHP are Facebook, Wikipedia, Quora, etc.

PHP Interview Questions

1) What is PHP?

PHP Stands for PHP Hypertext Preprocessor. It is an open-source scripting language, widely used for web development. PHP code is executed on the server, and the result is returned to the browser as plain HTML. The PHP was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994 with the file extension of ".Php".

2) What is $$ in PHP?

3) What is php full form?

The Full Form of PHP is PHP Hypertext Preprocessor. It is a general-purpose scripting language, especially used for web development.

4) What is PEAR in PHP?

5) What is difference between array_merge and array_combine in php?

Download Free : PHP Interview Questions PDF

6) What is use of sizeof function in php?

7) How to display array value in php?

8) What is the use of strlen( ) function in php?

9) How to create a mysql connection in PHP?

10) What is use of str_word_count() function in php?

Take Free: Php MCQ & Quiz

11) What is the use of strpos( ) function in php

12) How can you enable error reporting in PHP?

13) List some popular Content Management Systems (CMS) in PHP?

14) What the PHP-FIG?

15) What is composer?

A composer is a tool for dependency management in PHP. It allows us to declare the libraries our project depends on and it will manage (install/update) them for us. Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project.

16) What are magic constants in PHP?

Magic constants in PHP are the predefined constants, which get changed on the basis of their use. It starts with a double underscore (__) and ends with a double underscore. Magic constants are similar to other predefined constants but as they change their values with the context, they are called magic constants.

17) How to get ip address of user in PHP?

18) What is namespace in PHP?

Namespaces in PHP are designed to solve the two problems that authors of libraries and applications encounter when creating re-usable code elements such as classes or functions.

  • Name collisions between code you create, and internal PHP classes/functions/constants or third-party classes/functions/constants.
  • Ability to alias (or shorten) Extra_Long_Names designed to alleviate the first problem, improving the readability of source code.

19) What is a session in PHP?

20) Explain type juggling in PHP?

21) What is the difference between var_dump() and print_r()?

22) What is the difference between mysql_fetch_object() and mysql_fetch_array()?

23) What is difference between strstr() and stristr()?

24) What is use of nl2br() function in PHP?

25) How to define constant in PHP?

26) How do you register a variable in PHP session?

27) What are different types of errors available in PHP?

28) What is use of GD library in PHP?

29) What is use of PHP.ini file?

30) What is default time and path of session in PHP?


32) What is the factory pattern?

33) What is the difference between == and === in PHP?

34) How to pass data in header while using curl?

35) What is stdClass in PHP?

36) What is use of Null Coalesce Operator?

37) What is urlencode() and urldecode()?

38) How to create and destroy a cookie in PHP?

39) What are constructor and destructor in PHP?

40) What is a lambda function in PHP?

10 comment(s) :

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.