PHP: Hypertext Preprocessor - Formula Sheet
PHP Syntax and Operator Formulas
Below is a summary of standard syntax rules, data structure notations, and operator evaluations in PHP.
1. Standard Variable Assignment
Formula:
\(variable_name = value;
Definitions:
- \): Required symbol that initiates any variable declaration.
- variable_name: User-defined identifier starting with a letter or underscore.
- =: Assignment operator that transfers the right-hand value to the left-hand variable.
- value: The data being stored, which determines the automatic data type of the variable.
2. Concatenation and Concatenation Assignment
Formulas:
\(string3 = \)string1 . \(string2;
\)string1 .= \(string2;
Definitions:
- .: Concatenation operator that merges string operands into a single continuous string.
- .=: Concatenation assignment operator that appends the right-hand string to the left-hand variable.
3. Strict Identical Comparison
Formula:
\)result = (\(operand1 === \)operand2);
Definitions:
- ===: Identical operator. Returns true if value of operand1 is equal to value of operand2 AND their data types are identical.
- \$result: Boolean variable that stores the outcome (true or false).
4. Prefix and Postfix Arithmetic Operations
Formulas:
\(y = ++\)x; (Pre-increment)
\(y = \)x++; (Post-increment)
Definitions:
- ++\(x: Increments variable x by 1 first, then assigns the new value to y.
- \)x++: Assigns current value of x to y first, then increments x by 1.
More for this chapter
Book Back Questions10 textbook MCQs · solved
Additional MCQs15 extra MCQs · solved
Practice TestInteractive · instant score
Book Back TestTest yourself on the textbook set
Additional MCQ TestTest yourself on the extra set
Study NotesConcepts & methods
More chapters in Computer Applications
View all
1 Multimedia
2 An Introduction to Adobe PageMaker
3 Introduction to Database Management System
5 Functions and Arrays in PHP
6 Conditional Statements in PHP
7 Loops in PHP
8 Forms and Files
9 Connecting PHP and MYSQL
10 Introduction to Computer Networks
11 Network Examples and Protocols
12 Domain Name System (DNS)
13 Network Cabling
14 Open Source Concepts
15 E-Commerce
16 Electronic Payment Systems
17 E-Commerce Security Systems
18 Electronic Data Interchange- EDI