So, needless to say, this post will continue to grow over time.
Beginning and Ending Blocks
| Standard Tag | <?php | ?> | 
| Short Tag | <? | ?> | 
| Script Tag | <script language="php"> | </script> | 
Variables
Variables in PHP begin with a dollar ($) sign and either a letter or an _ (underscore).
Example:
$test
$_1234
$test
$_1234
Variables do not need to be declared as a type, the PHP engine decides the variable type based on type of data the variable holds.
Types of Variable:
| Integer | Whole number | 
| Double | Floating point number (Decimal Point) | 
| String | Collection of characters | 
| Boolean | True or false | 
Difference Between =, = =, and = = =
- = : Sets the value of a variable
- = = : Comparative operator; Means equivalent (Are variables X and Y apples?)
- = = = : Comparative operator; Means exactly the same (Are these apples exactly the same? Both have that green and dark red spot?)
 
 
No comments:
Post a Comment