PHP Programming Language
Uses of PHP Programming Language
- A programmer can use PHP to add, delete and modify elements within their databases
- PHP can encrypt data
- PHP allows you to restrict access to particular pages in your websites
- As a developer, programmer, or user, you can access cookies variables and set cookies
- PHP programming language is excellent with forms. It can gather data from files, save data to a file, send data through email, and return data to the user.
Characteristics of PHP
Scripting in PHP
PHP Environment Setup
- Web Server – PHP is a popular language because it virtually works with all web server software, including Microsoft’s IIS (Internet Information Server). However, the freely available and mostly used is the Apache Server. Apache can be downloaded free of charge.
- Database – Also, PHP works with almost all databases like Oracle, Sybase, MySQL, etc. MySQL is the most commonly used and freely available database.
- PHP Parser – The PHP Parser is responsible for processing PHP script instructions. It generates the HTML output that is sent to the web browser.
PHP Syntax Overview
- Escaping to PHP
Canonical PHP tags
SGML style (short-open) tags
- When you are building PHP, make sure that you choose the enable short tags configuration
- Turn on the “set the short_open_tag” setting in your php.ini file. Note that you should disable this option to parse XML with PHP. This is because the same syntax is used for XML tags.
HTML script tags
- Commenting on a PHP code
- PHP language is whitespace insensitive
- PHP is case sensitive
- PHP statements are expressions terminated by semicolons
- A combination of tokens forms expressions
- Blocks are made with braces
- In PHP, you can put statements anywhere by enclosing them in a set of curly braces.