PHP freshers Interview Questions PHP Interview Questions and Answers for Freshers & Experienced

Categories: Interview questions and answers Experienced Freshers PHP

Howdo you display the output directly to the browser?

Todisplay the output directly to the browser, I will use the specialtags <?= and ?>.

Explain the difference between static and dynamic websites?

Instatic websites, content can't be changed after running the script.You can't change anything on the site. It is predefined.
Indynamic 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.

What does PEAR stands for?

PEARstands for “PHP Extension and Application Repository”. PEAR is aframework and repository for all of the reusable PHPcomponents.PEAR provides a higher level of programming forweb developers. It contains all kinds of PHP code snippets andlibraries. It also provides you with a command-line interface toautomatically install packages.

Is PHP a case sensitive language?

PHPis partially case sensitive. The variable names are case-sensitivebut function names are not. If you define the function name inlowercase and call them in uppercase, it will still work.User-defined functions are not case sensitive but the rest of thelanguage is case-sensitive.

How to select a database?

ThePHP Data Objects (PDO) is a lightweight, and consistent interfaceused to access databases in PHP.

What types of loops exist in PHP?

for,while, do while and foreach.

What is PEAR in PHP?

PEARis a framework and repository for reusable PHP components. PEARstands for PHP Extension and Application Repository. It contains alltypes of PHP code snippets and libraries. It also provides a commandline interface to install “packages” automatically. Team
The content on R4R is created by expert teams.