What is PHP?
PHP is a programming language for building dynamic, interactive Web sites. As a general rule, PHP programs run on a Web server, and serve Web pages to visitors on request. One of the key features of PHP is that you can embed PHP code within HTML Web pages, making it very easy for you to create dynamic content quickly.
What exactly does the phrase "dynamic, interactive Web sites" mean? A dynamic Web page is a page whose contents can change automatically each time the page is viewed. Contrast this with a static Web page, such as a simple HTML file, which looks the same each time it's displayed (at least until the page is next edited). Meanwhile, an interactive Web site is a site that responds to input from its visitors. A Web forum is a good example users can post new messages to the forum, which are then displayed on the site for all to see. Another simple example is a contact us form,
Where visitors interact with the page by filling out and sending a form, which is then emailed to the Webmaster.
PHP stands for PHP: Hypertext Preprocessor, which gives you a good idea of its core purpose: to process information and produce hypertext (HTML) as a result. (Developers love recursive acronyms,
and PHP: Hypertext Preprocessor is a good example of one.)
The process of running a PHP script on a Web server looks like this:
- The Web server recognizes that the requested URL is a PHP script, and instructs the PHP engine to process and run the script
- The script runs, and when its finished it usually sends an HTML page to the Web browser, which the visitor then sees on their screen.