PHP Interview Questions
1 .
What is htaccess? Why do we use this and where?
htaccess files are configuration files of Apache Server that provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory.
2 .
What are PHP Operators ?
PHP Operators are used to perform operations on variables and values. PHP Operators can be categorized in following groups :

Arithmetic operators
Assignment operators
Comparison operators
Increment/Decrement operators
Logical operators
String operators
Array operators
3 .
Explain PHP Arrays.
An array is a data structure that stores one or more similar type of values in a single variable.

There are three different kind of arrays and each array value is accessed using an ID c which is called array index.

Indexed arrays : An array with a numeric index. Values are stored and accessed in linear fashion.

Associative array : An array with strings as index. This stores element values in association with key values rather than in a strict linear index order.

Multidimensional array : An array containing one or more arrays and values are accessed using multiple indices.
4 .
Explain the difference b/w static and dynamic websites?
Static websites content can't be changed after running the script. You can't change anything in the site. It is predefined.

Dynamic websites content of script can be changed at the run time. Its content is regenerated every time a user visit or reload. Google, yahoo and every search engine is the example of dynamic website.
5 .
What are the popular Content Management Systems (CMS) in PHP?
Drupal etc.
6 .
What are the popular frameworks in PHP?
Cake PHP
Yii Framework etc.
7 .
How will you get information sent via post method in PHP?
The PHP provides $_POST associative array to access all the sent information using POST method.
8 .
How can we access the data sent through the URL with the GET method?
In order to access the data sent via the GET method, we you use $_GET array like this :
$variable = $_GET[“var”]; this will now contain ‘value’
9 .
How do you define a constant ?
Constants in PHP are defined using define() directive, like define("FTLCONSTANT", 100);
10 .
What is the difference between PHP and JavaScript?
javascript is a client side scripting language, so javascript can make popups and other things happens on someone’s PC. While PHP is server side scripting language so it does every stuff with the server.