The purpose of this project is creating all usable ways of PHP coding.
This gist will contain:
- Variables
- Control Structures
- Loops
- Classes
- [More to come]
| <?php | |
| /** | |
| * PHP Cheat Sheet | |
| * | |
| * Purpose: Creating a cheat sheet for PHP | |
| */ | |
| /** | |
| * Standart variable creation | |
| */ | |
| $a = 1; | |
| $_b = "some text"; | |
| $c = array( | |
| 'a' => 1, | |
| 'b' => "Some text", | |
| 4, | |
| 6 | |
| ); | |
| $d = true; | |
| $e = 1.23; | |
| /** | |
| * Defining same value to multiple variables | |
| */ | |
| $a = $b = $c = 1; | |
| /** | |
| * Defining a variable's value as variable | |
| */ | |
| $a = "b"; | |
| $$a = 1; |