Php Interview Question TULSI RAM RATHOR द्वारा विज्ञान में हिंदी पीडीएफ

Featured Books
श्रेणी
शेयर करे

Php Interview Question

PHP stands for PHP: Hypertext Preprocessor is a widely used open-source server-side scripting language especially suited for creating dynamic websites and mobile APIs.

PHP supports many databases like MySQL, Solid, PostgreSQL, Oracle, Sybase, generic ODBC, etc. PHP code is embedded within HTML.

It is used to manage dynamic content, session tracking, databases, and also to build an entire e-commerce site.
By default, most of the web hosting servers support PHP and thus it contributes to cost-effectiveness.

Scope of PHP
PHP stands as one of the top languages because of its ability to have a large impact on the outcome with very little code. This amount of efficiency has been the requirement for the past few years in the industry.

On seeing this, companies are investing a good amount of money in hiring proficient PHP developers to fit these shoes and work effectively.

Today, this article will walk you through the most commonly asked PHP interview questions for freshers and experienced in the industry.

 

PHP Interview Questions For Freshers
1. Differentiate between variables and constants in PHP
Few difference between variables and constants in PHP are given below:

Variables
Constants
The value of a variable can be changed during the execution.
The constant value can’t be changed during script execution.
Variables require compulsory usage of the $ sign at the start.
No dollar sign ($) is required before using a constant.
It is possible to define a variable by simple assignment.
Constants can’t be defined by simple assignments. They are defined using the define() function.
The default scope is the current access scope.
Constants can be accessed throughout without any scoping rules.
 
2. What is a session in PHP?
A session in PHP is a way to store information to be used across multiple pages of an entire website. The information is not stored on the user’s computer, unlike cookies. In a temporary directory on the server, a file will be created by the session where registered session variables and their values are stored. This information will be available to all pages on the site during that visit.

When you work with an application, you open it, do some modifications, and then you close it. This is much like a Session. The computer knows who you are. It knows when the application is started and ended by you.

But on the internet, the webserver does not know who you are or what you do, because the HTTP address doesn’t maintain a state. This problem is solved using session variables by storing user information to be used across multiple pages (e.g. username, favorite color, etc).

By default, session variables will last until the user closes the browser.

So Session variables hold single user information and are available to all pages in one application.
 
3. What does PEAR stands for?
PEAR stands for “PHP Extension and Application Repository”. PEAR is a framework and repository for all of the reusable PHP components.

PEAR provides a higher level of programming for web developers. It contains all kinds of PHP code snippets and libraries. It also provides you with a command-line interface to automatically install packages.