What is PHP?
PHP is an open source and eventually the name changed to PHP Hypertext Pre-procesor.
Advantage of PHP:
a. easy to use
b. open source
c. multiple platform
d. language support for database
- must saved with a php extension
- must be terminated with a semicolon ;
- not generally case-sensitive
- character to indicate Comments : - // or # : single line
- - /* here is an introduction to server side script code inside a multi-line comment */ : multi-line comment
PHP Syntax
1. PHP comment
2. Output / Display statement
Variables and Data Type
- variable contain a piece of data
- all variable in PHP begin with a $
- variable names are case sensitive
Operator
Conditional Statement and Loops
Arrays
- array is a variable only contain a multiple value under a single variable name
- Example: To store information about a car in an array, we could use the following line;
$CarInfo = array ("Avanza", "2004", 34500);
// an array could contain different type of variables
OR
$CarInfo = array();
$CarInfo [0] = "Innova";
$CarInfo [1] = "2002";
$CarInfo [2] = 34500;



No comments:
Post a Comment