Top 10 Interview Questions and Answers for PHP freshers
What is difference between $_GET and $_POST?
$_GET stores data sent by HTML form ‘get’ method or the value of variable encoded with URL whereas the $_POST collects the data submitted by “post” method of HTML form. $_GET has a character limit whereas no such limit defined by PHP for the POST.
How many types of array are there in PHP?
Basically, there are three types of arrays in PHP
1- Indexed arrays
2- Associative arrays
3- Multidimensional Arrays
How to convert a string into array and vice-versa?
We can cover an array into a string and a string into an array using explode() and implode() methods.These methods use some delimiter to concat values of arrays and also at the time of splitting a string into an array.
How you can find IP address of Local machine accessing PHP sites?
PHP has a number of superglobals.$_SERVER has some autodetected values. We can use this variable to get the IP address as given below:
In how many ways we can fetch data from MySQL database?
There are four standard ways to fetch data from MySQL database in PHP. They are listed below:
Is PHP an Open Source?
Yes, PHP is absolutely free, and it is an Open Source.It can be used under GPL.
Does PHP supports OOPs Features?
Yes, PHP is a full-featured server-side scripting language and enriched with Object Oriented Programming system approach. We can define a class, constructor. We can create Objects and can implement oops features like Abstraction, Polymorphism, Inheritance, and Encapsulation.
What is the difference between array_merge and array_combine?
We can differentiate between the two terms while understanding their definitions.
array_merge(): Merge Elements of arrays in a single array while preserving their indexes. But array_combine() returns a new array where values in one array are keys in new arrays and values of another array values in new arrays.
What is the Latest stable version of PHP and MySQL?
You should check these things before your Interview because the version the things are updating frequently.
For PHP: www.php.net
For MySQL: www.mysql.com