PHP

Stands for "PHP: Hypertext Preprocessor."

PHP is a scripting language web developers use to create dynamic websites. It is often installed by default on Apache web servers, alongside MySQL as part of a "LAMP" configuration.

Each PHP code snippet starts with <?php and ends with ?>. PHP pages may contain multiple snippets inserted throughout the HTML that generate dynamic content. When a website visitor accesses a PHP page, the web server processes, or "parses," the PHP code before sending the HTML to the client's browser. In the example below, the PHP function gets the local time and date from the server and inserts it into the HTML. ("F d, Y" formats the date as December 31, 2021.)

<p>The current date is <?php echo date("F d, Y"); ?></p>

Below is a behind-the-scenes look at some of the PHP code used to generate quiz questions on TechTerms.com.

PHP scripts can range from simple one-line commands to complex functions. Some PHP-based websites generate nearly all webpage content dynamically using a series of PHP scripts. While early versions of PHP were not object-oriented, PHP3 introduced support for classes, including object attributes and methods. Developers can create custom object libraries and import them into various PHP pages, similar to a compiled language.

Because PHP code is processed before the HTML is loaded, users cannot view the PHP code within a webpage. They can only see the HTML output by the PHP scripts.

Much of PHP's syntax is similar to other languages such as C++, Java, and Perl. However, PHP contains several proprietary functions, including MySQL-specific methods for accessing records from a MySQL database. Because of its integration with MySQL, its consistent maintenance, and overall ease of use, PHP remains a popular choice for creating dynamic websites.

File extension: .PHP

Updated November 6, 2024 by Per C.

quizTest Your Knowledge

Which of the following is a learning management system?

A
Moodle
0%
B
Weebly
0%
C
GoDaddy
0%
D
LinkedIn
0%
Correct! Incorrect!     View the Moodle definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of PHP on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.