PHP |
Values |
Operators |
Functions |
Arrays |
Forms |
Sessions-Cookies |
Classes
PHP is a server and scripting language for processing dynamic webpages. A PHP file is any plain text file named with a .php extension. The standard XHTML tags are required when PHP and XHTML are coded together.
A PHP file can have one or more scripts. The <?php tag opens a script and ?> closes a script. A script is a series of commands. A command defines a statement. A statement generates an action. The ; semicolon declares the end of a statement. Multiple statements generated as a block are declared within { } curly brackets...
Comments can be added in PHP for notes or reminders. Comments are visible in the source code, but not the browser...
A variable, also known as a scalar, is a command that stores a single value. Variable names are created and case-sensitive, but must be declared with the $ dollar sign and only include letters, numbers, and underscores. A number is not allowed as the first character. The lowercase or camelCap convention is recommended. A variable is assigned a value with the = equal sign as the assignment operator.
The echo command outputs data to a browser...
The output to the browser is...
1
Various other commands are used in PHP. An array is like a variable, but stores multiple values. A function is like a command, but has more complex features.
Tutorials for installation and configuration of PHP are on the Install page.