(from Full Article) Here are most types of PHP Operators: Assignment Operators, Arithmetic Operators, Comparison Operators, and String Operators. Assignment Operators We have already met this type. This is where we set a variable equal to something or make a variable equal to another variable. Arithmetic Operators English Operator Example Addition + 1+1 Subtraction – [...]
Monthly Archives: October 2009
PHP Concatenation
(from Full Article) We can display our variables in a meaningful fashion with the use of concatenation. Concatenation makes use of the period (.). Please see the example below which is an example of affixing a value to the end of the variable: <?php $name = “Marc”; $name .= “Fraser”; ?> Basically what ‘.=’ is [...]
PHP Variables
(from Full Article) Variables are important to PHP. A variable is a way of storing a value, such as text (“Hello”), numeric values (such as the integer value of 1) and also Boolean values (true and false). A variable can be re-used throughout your code instead of typing out the value over and over again. [...]
Outputting HTML using PHP [+ Semicolons]
(from Full Article) Semicolons Semicolons are used extensively in PHP. The semicolon generally (there are exceptions) signifies the end of a PHP statement and should not be forgotten, otherwise unsightly errors will occur. An example will be shown in the Outputting HTML code using PHP section. Outputting HTML code using PHP Outputting HTML code using [...]
PHP Comments
(from Full Article) We place comments in PHP code to make the code more maintainable and readable. These comments will not be viewable to the public, only to the person editing the PHP file. To comment in PHP we should prefix ‘//’ to our comment, for example: <?php //This is our comment ?> We can [...]