PHP Interview Questions: PHP Interview Questions And Answers for freshers and experienced

Q:- What is PHP? Why it is used PHP?
Q:- What is the latest version of PHP?
Q:- What are the advantages of PHP?
Q:- Who is the developer of PHP?
Q:- How to get IP Address of clients machine in PHP?
Q:- How many types of errors in PHP?
Q:- How can we make a constant in PHP?
Q:- In PHP, how to redirect from one page to another page?
Q:- What is the meaning of "enctype= multipart/form-data" in PHP?
Q:- How to add comments in PHP?
Q:- What is the difference server side and browser side validation?
Q:- How to create and destroy cookies in PHP?
Q:- What is the difference between fopen() and fclose()?
Q:- What is str_replace()?
Q:- What is substr() in PHP? and how it is used?
Q:- What the use of var_dump()?
Q:- What is the use of nl2br() in PHP?
Q:- How can we upload a file in PHP?
Q:- How to download files from an external server with code in PHP?
Q:- What are the Headers in PHP?
Q:- What is the role of the .htaccess file in php?
Q:- Explain the difference between array_merge() and array_combine()?
Q:- How to get a total number of elements used in the array?
Q:- What is the difference between public, protected and private?
Q:- How to remove HTML tags from data in PHP?
Q:- Please explain the difference between $var and $$var?
Q:- How to get complete current page URL in PHP?
Q:- How can we enable error reporting in PHP?
Q:- What is the use of @ in Php?
Q:- What is the use of cURL()?
Q:- How to remove blank spaces from the string?
Q:- How to include a file code in different files in PHP?
Q:- List some sorting functions in PHP?
Q:- What is a composer?
Q:- What is the use of $_SERVER["PHP_SELF"] variable?
Q:- How we get browser details of clients machine?
Q:- Write a program to display Reverse of any number?
Q:- Write a program to display a table of any given number?
Q:- How to write a program to make chess?
Q:- How to redirect https to HTTP URL through .htaccess?
Q:- What is the Apache?
Q:- What is PEAR in PHP?
Q:- What are getters and setters and why are they important?
Q:- How to increase the maximum execution time of a script in PHP?
Q:- What is the purpose of break and continue statement?
Q:- How to remove duplicate values from array using PHP?
Q:- What is the role of php.ini file in PHP?
Q:- How to send email using php script?
Q:- How to find the index of an element in an array PHP?
Q:- How to check a variable is an array or not in PHP?
Q:- How to check an element is exists in array or not in PHP?
Q:- How to avoid email sent through PHP getting into the spam folder?
Q:- What is PHP Array Functions?
Q:- What is PHP String Functions?
Q:- How to make database connection in PHP?
Q:- What are aggregate functions in MySQL?
Q:- What is the role of a limit in a MySQL query?
Q:- How to get a total number of rows available in the table?
Q:- What are the different MySQL database engines?
Q:- What is SQL injection?
Q:- Find the 2nd highest salary of an Employee?
Q:- Find last inserted id after insert data from a table?
Q:- What is Class and Object in PHP?
Q:- What is MVC?
Q:- What is namespace in PHP?
Q:- What are the final class and final method?
Q:- What are the __construct() and __destruct() methods in a PHP class?
Q:- What is inheritance in PHP? How many types of inheritance supports PHP?
Q:- What are traits? How is it used in PHP?
Q:- What are magic methods?
Q:- What is the difference between unlink() and unset()?
Q:- What is the difference between == and === in PHP?
Q:- What is the difference between require() and require_once()?
Q:- What is the main difference between require() and include()?
Q:- What is the difference between implode() and explode() in php?
Q:- Difference between file_get_contents() and file_put_contents() in PHP?
Q:- What is the difference between php 5 and php 7?
Q:- What is the difference between Apache and Tomcat?
Q:- What is the difference between REST and Soap?
Q:- What is the difference between abstract class and interface in php?
Q:- What is the difference between MyISAM and InnoDB?
Q:- What is the difference between GET & POST ?
Q:- Please explain the difference between isset() and empty()?
Q:- Difference between mysql_fetch_array(), mysql_fetch_object()?
Q:- What is the difference between mysql and mysqli?
Q:- What are the differences between PHP constants and variables?
Q:- What is the difference between overloading and overriding in PHP?
Q:- Explain the difference between session and cookies in PHP?
Q:- Write a program to swap two numbers using PHP.
Q:- Write a program to display table of a number using PHP?
Q:- Write a program to get LCM of two numbers using PHP?
Q:- Write a program to get second highest number in an array using PHP?
Q:- How to check whether a number is Prime or not?