SUPPORT THE WORK

PHP

TABLE OF CONTENTS
      • Syntax
      • External Links
ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
discussion  →
forked  →
imported  →
original  →
edit classify history index PHP
PHP (PHP Hypertext Preprocessor) is a programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone GUI applications. The main implementation is produced by “The PHP Group” and released under the PHP License. It is considered to be free software and is available in most distributions. PHP is generally run on a web server, like Apache, taking PHP code as its input and creating web pages as output. The PHP Group also provides the complete source code for users to build, customize and extend for their own use.

Server-Side Scripting

Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting. While running the PHP parser with a web server and web browser, the PHP model can be compared to other server-side scripting languages such as Perl, ASP, JSP, Ruby on Rails, and others which provide dynamic content to the client from a web server (and often, a database as well). The LAMP architecture has become popular across many industries as a way of deploying inexpensive, reliable, scalable, secure web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MariaDB. PHP can be used with a large number of relational database management systems, runs on all of the most popular web servers and is available for many different Operating Systems. This flexibility means that PHP has a wide installation base across the Internet. Examples of server-side PHP applications include the original Google, phpBB, WordPress, GetWiki, and many, many others. PHP also provides a command line interface (CLI) for developing shell and desktop applications, daemons, log parsing, or other system administration tasks. It is increasingly used on the command line for tasks that have traditionally been the domain of Perl, Python, awk, or shell scripting.

Syntax

PHP can be used as a filter. The PHP program takes input from a file or stream containing text and special PHP instructions and outputs another stream of data for display. From PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor.

The usual “Hello World” code example for PHP is:
<?php
	echo “Hello, World!”;
?>


The example above is equivalent to the following text (and indeed is converted into this form):

Hello, World!

PHP only parses code within its delimiters, and anything outside is sent directly to the output and is not parsed. The primary use of this is to easily allow PHP statements to be embedded within HTML documents, for example:

<?php
	// PHP statements here
?>


Regular HTML here

<?php
	// PHP statements here
?>


Variables are prefixed with a “$” and a type does not usually need to be specified in advance, although this is changing, as PHP becomes more like a strongly “typed” language. Unlike function and class names, variable names are case sensitive. Both double-quoted and single-quoted strings allow one to embed the variable's value into the string. PHP treats new lines as whitespace, in the manner of a free-form language (except when inside string quotes). Statements are terminated by a semicolon, except in a few special cases. PHP has three types of comment syntax: /* */ which serves well for block comments, and // as well as # which is used for inline comments.

Notes and References

  • 2006-09-13, Is PHP The Cure For The 'Broken' Web?, internetnews.com, Kerner, Sean Michael , www.internetnews.com/dev-news/article.php/3631831
  • 2006-10-31, Microsoft Opens PHP Door, internetnews.com, Kerner, Sean Michael, www.internetnews.com/dev-news/article.php/3641101
  • Jason E. Sweat, Guide to PHP Design Patterns, PHP|architect, 2005, ISBN 0-9735898-2-5
  • Ilia Alshanetsky, Guide to PHP Security, PHP|architect, 2005, ISBN 0-9738621-0-6
  • Chris Shiflett, Essential PHP Security, O'Reilly Media, 2005, ISBN 0-596-00656-X
  • Larry Ullman, PHP and MySQL for Dynamic Web Sites, Peachpit Press, 1st Edition, 2003, ISBN 0-321-18648-6

  1. php.net/manual/en/introduction.php, PHP Manual, Introduction, 2006-11-15.

Adapted
Some content has been imported, adapted, and corrected from: 'PHP' (Pseudopedia).
and Released as applies under GNU FDL and/or CCL Terms
edit classify history index
[ Last Updated: 3:28pm EDT - Monday, 13 Oct 2025 ]
[ GetWiki: Since 2004 ]
LATEST EDITS [ see more ]
GETWIKI 22 DEC 2025
GETWIKI 31 OCT 2025
GETWIKI 31 OCT 2025
GETWIKI 31 OCT 2025
GETWIKI 31 OCT 2025
CONNECT