PHP ARTICLE
History of PHP
PHP was conceived sometime in the fall of 1994 by Rasmus Lerdorf.Early non-released versions were used on his home page to keep track of who was looking at his online resume. The first version used by others was available sometime in early 1995 and was known as the Personal Home Page Tools.
PHP Introduction
What is PHP?
- PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.
- PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
- PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.
- It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
- PHP is forgiving: PHP language tries to be as forgiving as possible.
Characteristics of PHP
Five important characteristics make PHP's practical nature possible −
Familiarity
Simplicity
Security
Efficiency
Flexibility
PHP Syntax
- This chapter will give you an idea of very basic syntax of PHP and very important to make your PHP foundation strong.
Basic PHP Syntax
<?php
// PHP code goes here
?>
- The default file extension for PHP files is ".php".
- we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function "echo" to output the text "BUIE LEARNING" on a web page:
Example
PHP Case Sensitivity
Example
PHP Variables
Rules for PHP variables:
- A variable name must start with a letter or the underscore character
- A variable starts with the $ sign, followed by the name of the variable
- A variable name cannot start with a number
- Variable names are case-sensitive ($age and $AGE are two different variables)
Output Variables