What is PHP
PHP is a server scripting language
, and a powerful tool for making dynamic and interactive Web pages.
PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
PHP 7 is the latest stable release.
Introduction
What You Should Already Know
Before you continue you should have a basic understanding
of the following:
- HTML
- CSS
- JavaScript
What is PHP?
- PHP is an acronym for "PHP: Hypertext Preprocessor"
- PHP is a widely-used, open source scripting language
- PHP scripts are executed on the server
- PHP is free to download and use
Installation
What Do I Need to Install?
To start using PHP, you can:
- Find a web host with PHP and MySQL support
- Install a web server on your own PC, and then install PHP and MySQL
Set Up PHP on Your Own PC
If your server does not support PHP, you must:
- Instal a
Web Server
- Instal PHP
- Instal a Database, such as MySQL
The official PHP website (PHP.net ) has installation instructions for PHP: http://php.net/manual/en/install.php
PHP Variables
Variables
are "containers" for storing information.
In PHP, a variable starts with the $ sign, followed by the name of the variable
Example: $variable = "Hello World"
Comments
Comments in PHP
A comment in PHP code is a line that is
not executed
as a part of the program. Its only purpose is to be read by someone who is looking at the code.Comments can be used to: