9 PHP interview questions and answers

Looking for PHP freelancers to build your team? Review Toogit's top PHP expert

Get Started

Hire Trusted PHP Freelancers for your project

More than 150,000 freelancers ready to tackle any kind of project


PHP stands for Hypertext Pre-processor. It is an open source server-side scripting language which is widely used for web development. It supports many databases like MySQL, Mongo, Oracle, Sybase, Solid, PostgreSQL, generic ODBC etc.
In static websites, content can't be changed after running the script. You can't change anything in the site. It is predefined.
In 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.
Zend Framework etc.
PHP Engine creates a logical object to preserve data across subsequent HTTP requests, which is known as session.
Sessions generally store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same user.
Simply, it maintains data of a user (browser).
PHP session_start() function is used to start the session. It starts a new or resumes the existing session. It returns the existing session if session is created already. If session is not available, it creates and returns new sessions.
The main difference between session and cookie is that cookies are stored on user's computer in the text file format while sessions are stored on the server side.
Cookies can't hold multiple variables on the other hand Session can hold multiple variables.
You can manually set an expiry for a cookie, while session only remains active as long as browser is open.
Actually PHP is a server side scripting language( Server-side scripts connect the web page with a database or application) such as asp or jsp .

php stood for personal home page , but now it stand for recursive acronym hypertext preprocessor. It was created by rasmus lerdorf in 1994.

Anyone who already has a website and is familiar with HTML can easily make the step to PHP. In fact, PHP and html are interchangeable within the page. You can put PHP outside the HTML or inside.

While PHP adds new features to your site, the basic appearance is still all created with HTML so your PHP code get hide automatically.

Why use php :

PHP runs on different platforms such as Windows, Linux, Unix, etc.
PHP is easy and fast to learn and runs efficiently on the server side.
We can easily master PHP as the PHP syntax is somewhat similar to C,perl.
It is compatible with almost all servers used today,such as Apache, IIS, etc.
It supports many databases such as MySQL, Oracle, PostgreSQL etc.
PHP is perfectly suited for Web development and can be embedded directly into the HTML code(As mentioned above).
PHP can also be used to create dynamic web pages that are generated from information accessed from a MySQL database.
It is often used together with Apache (web server) on various operating systems. It can be also used with Microsoft's IIS on Windows.
php is open source and it is free downloadable (freely downloadable from from Hypertext Preprocessor and Zend the PHP Company).
Php will get more response when it will have more security. In these days most of us fear of its security issue.
In case PHP is killed, it gotta kill a number of giant websites first. For example, Facebook, Wikipedia, the whole Wordpress systems, etc. The percentage of PHP in compare with all other web programming languages is still pretty amazing, such as:

1.2% of websites using Magento
2.2% of websites using Drupal (including some government websites)
3.3% of websites using Joomla
27.8 % of websites using Wordpress

Which in total 34.5% of websites was built using popular PHP frameworks and CMS.
Chances of PHP will be died in 2018 is nearly impossible, and people won't let it happen anytime soon
PHP is a scripting language, Ruby on Rails is a web development framework based on the scripting language Ruby. Some PHP frameworks were mentioned (li3 lithium, CakePHP, Symfony, Kohana3, CodeIgniter, Zend).

PHP is widely in use as the programming language of projects like Wordpress, Joomla, Drupal and Magento.

PHP is considered to be faster, less stable, have more documentation, more widespread and more widely available on hosting services.

Some argue that PHP had a place in earlier years of web development history, but that ruby on rails (or python and django) are more progressive, more fitting for where the web is headed.

Hire Top PHP Freelancers

PHP At A Glance

PHP development began in 1994 when Rasmus Lerdorf wrote several Common Gateway Interface (CGI) programs in C, which he used to maintain his personal homepage. He extended them to work with web forms and to communicate with databases, and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI.


PHP/FI could be used to build simple, dynamic web applications. To accelerate bug reporting and improve the code, Lerdorf initially announced the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0" on the Usenet discussion group comp.infosystems.www.authoring.cgi on June 8, 1995. This release already had the basic functionality that PHP has today. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax resembled that of Perl, but was simpler, more limited and less consistent.


Early PHP was not intended to be a new programming language, and grew organically, with Lerdorf noting in retrospect: "I don't know how to stop it, there was never any intent to write a programming language. I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way." A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.


The fact that PHP was not originally designed, but instead was developed organically has led to inconsistent naming of functions and inconsistent ordering of their parameters. In some cases, the function names were chosen to match the lower-level libraries which PHP was "wrapping", while in some very early versions of PHP the length of the function names was used internally as a hash function, so names were chosen to improve the distribution of hash values.

Skills related to PHP

Are you a start-up founder or planning to create a website?

Get it done with Toogit's powerful project management tool.