├── .gitignore ├── 01_output.php ├── 02_variables.php ├── 03_arrays.php ├── 04_conditionals.php ├── 05_loops.php ├── 06_functions.php ├── 07_array_functions.php ├── 08_string_functions.php ├── 09_superglobals.php ├── 10_get_post.php ├── 11_sanitizing_inputs.php ├── 12_cookies.php ├── 13_sessions.php ├── 14_file_handling.php ├── 15_file_upload.php ├── 16_exceptions.php ├── 17_oop.php ├── _starter_files ├── 01_output.php ├── 02_variables.php ├── 03_arrays.php ├── 04_conditionals.php ├── 05_loops.php ├── 06_functions.php ├── 07_array_functions.php ├── 08_string_functions.php ├── 09_superglobals.php ├── 10_get_post.php ├── 11_sanitizing_inputs.php ├── 12_cookies.php ├── 13_sessions.php ├── 14_file_handling.php ├── 15_file_upload.php ├── 16_exceptions.php ├── 17_oop.php ├── feedback │ ├── about.html │ ├── feedback.html │ ├── img │ │ └── logo.png │ └── index.html └── package.json ├── extras ├── dashboard.php ├── logout.php └── users.txt ├── feedback ├── about.php ├── config │ └── database.php ├── feedback.php ├── img │ └── logo.png ├── inc │ ├── footer.php │ └── header.php └── index.php ├── package-lock.json ├── package.json ├── readme.md └── uploads └── Abstract-PNG-Images.png /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | script.txt -------------------------------------------------------------------------------- /01_output.php: -------------------------------------------------------------------------------- 1 | Hello'; 9 | 10 | // print - Similar to echo, but a bit slower 11 | print 'Hello'; 12 | 13 | // print_r - Gives a bit more info. Can be used to print arrays 14 | print_r('Hello'); 15 | print_r([1, 2, 3]); 16 | 17 | // var_dump - Even more info like data type and length 18 | var_dump('Hello'); 19 | var_dump([1, 2, 3]); 20 | 21 | // Escaping characters with a backslash 22 | echo "Is your name O\'reilly?"; 23 | 24 | /* ------------ Comments ------------ */ 25 | 26 | // This is a single line comment 27 | 28 | /* 29 | * This is a multi-line comment 30 | * 31 | * It can be used to comment out a block of code 32 | */ 33 | 34 | // If there is more content after the PHP, such as this file, you do need the ending tag. Otherwise you do not. 35 | ?> 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | My PHP Website 45 | 46 | 47 | 48 |

Hello

49 | 50 |

Hello

51 | 52 | -------------------------------------------------------------------------------- /02_variables.php: -------------------------------------------------------------------------------- 1 | ' . $name . ' is ' . $age . ' years old'; 44 | 45 | // Arithmetic Operators 46 | 47 | echo 5 + 5; 48 | echo 10 - 6; 49 | echo 5 * 10; 50 | echo 10 / 2; 51 | 52 | // Constants - Cannot be changed 53 | define('HOST', 'localhost'); 54 | define('USER', 'root'); 55 | 56 | var_dump(HOST); 57 | -------------------------------------------------------------------------------- /03_arrays.php: -------------------------------------------------------------------------------- 1 | 'red', 32 | 2 => 'green', 33 | 3 => 'blue', 34 | ]; 35 | 36 | // echo $colors[1]; 37 | 38 | // Strings as keys 39 | $hex = [ 40 | 'red' => '#f00', 41 | 'green' => '#0f0', 42 | 'blue' => '#00f', 43 | ]; 44 | 45 | echo $hex['red']; 46 | var_dump($hex); 47 | 48 | /* ---- Multi-dimensional arrays ---- */ 49 | 50 | /* 51 | Multi-dimansional arrays are often used to store data in a table format. 52 | */ 53 | 54 | // Single person 55 | $person1 = [ 56 | 'first_name' => 'Brad', 57 | 'last_name' => 'Traversy', 58 | 'email' => 'brad@gmail.com', 59 | ]; 60 | 61 | // Array of people 62 | $people = [ 63 | $person1, // [...$person1] 64 | [ 65 | 'first_name' => 'John', 66 | 'last_name' => 'Doe', 67 | 'email' => 'john@gmail.com', 68 | ], 69 | [ 70 | 'first_name' => 'Jane', 71 | 'last_name' => 'Doe', 72 | 'email' => 'jane@gmail.com', 73 | ], 74 | ]; 75 | 76 | var_dump($people); 77 | 78 | // Accessing values in a multi-dimensional array 79 | echo $people[0]['first_name']; 80 | echo $people[2]['email']; 81 | 82 | // Encode to JSON 83 | var_dump(json_encode($people)); 84 | 85 | // Decode from JSON 86 | $jsonobj = '{"first_name":"Brad","last_name": "Traversy","email":"brad@gmail.com"}'; 87 | var_dump(json_decode($jsonobj)); 88 | -------------------------------------------------------------------------------- /04_conditionals.php: -------------------------------------------------------------------------------- 1 | Greater than 10 | <= Less than or equal to 11 | >= Greater than or equal to 12 | == Equal to 13 | === Identical to 14 | != Not equal to 15 | !== Not identical to 16 | */ 17 | 18 | /* ---------- If Statements --------- */ 19 | 20 | /* 21 | ** If Statement Syntax 22 | if (condition) { 23 | // code to be executed if condition is true 24 | } 25 | */ 26 | 27 | $age = 20; 28 | 29 | if ($age >= 18) { 30 | echo 'You are old enough to vote!'; 31 | } else { 32 | echo 'Sorry, you are too young to vote.'; 33 | } 34 | 35 | // Dates 36 | // $today = date("F j, Y, g:i a"); 37 | 38 | $t = date('H'); 39 | 40 | if ($t < 12) { 41 | echo 'Have a good morning!'; 42 | } elseif ($t < 17) { 43 | echo 'Have a good afternoon!'; 44 | } else { 45 | echo 'Have a good evening!'; 46 | } 47 | 48 | // Check if an array is empty 49 | // The isset() function will generate a warning or e-notice when the variable does not exists. The empty() function will not generate any warning or e-notice when the variable does not exists. 50 | 51 | $posts = []; 52 | 53 | if (!empty($posts[0])) { 54 | echo $posts[0]; 55 | } else { 56 | echo 'There are no posts'; 57 | } 58 | 59 | /* -------- Ternary Operator -------- */ 60 | /* 61 | The ternary operator is a shorthand if statement. 62 | Ternary Syntax: 63 | condition ? true : false; 64 | */ 65 | 66 | // Echo based on a condition (Same as above) 67 | echo !empty($posts[0]) ? $posts[0] : 'There are no posts'; 68 | 69 | // Assign a variable based on a condition 70 | $firstPost = !empty($posts[0]) ? $posts[0] : 'There are no posts'; 71 | 72 | $firstPost = !empty($posts[0]) ? $posts[0] : null; 73 | 74 | // Null Coalescing Operator ?? (PHP 7.4) 75 | // Will return null if $posts is empty 76 | // Always returns first parameter, unless first parameter happens to be NULL 77 | $firstPost = $posts[0] ?? null; 78 | 79 | var_dump($firstPost); 80 | 81 | /* -------- Switch Statements ------- */ 82 | 83 | $favcolor = 'red'; 84 | 85 | switch ($favcolor) { 86 | case 'red': 87 | echo 'Your favorite color is red!'; 88 | break; 89 | case 'blue': 90 | echo 'Your favorite color is blue!'; 91 | break; 92 | case 'green': 93 | echo 'Your favorite color is green!'; 94 | break; 95 | default: 96 | echo 'Your favorite color is not red, blue, nor green!'; 97 | } 98 | -------------------------------------------------------------------------------- /05_loops.php: -------------------------------------------------------------------------------- 1 | "; 16 | } 17 | 18 | /* ------------ While Loop ------------ */ 19 | 20 | /* 21 | ** While Loop Syntax 22 | while (condition) { 23 | // code to be executed 24 | } 25 | */ 26 | 27 | $x = 1; 28 | 29 | while ($x <= 5) { 30 | echo "Number: $x
"; 31 | $x++; 32 | } 33 | 34 | /* ---------- Do While Loop --------- */ 35 | 36 | /* 37 | ** Do While Loop Syntax 38 | do { 39 | // code to be executed 40 | } while (condition); 41 | 42 | do...while loop will always execute the block of code once, even if the condition is false. 43 | */ 44 | 45 | do { 46 | echo "Number: $x
"; 47 | $x++; 48 | } while ($x <= 5); 49 | 50 | /* ---------- Foreach Loop ---------- */ 51 | 52 | /* 53 | ** Foreach Loop Syntax 54 | foreach ($array as $value) { 55 | // code to be executed 56 | } 57 | */ 58 | 59 | // Loop through an array 60 | 61 | $numbers = [1, 2, 3, 4, 5]; 62 | 63 | foreach ($numbers as $x) { 64 | echo "Number: $x
"; 65 | } 66 | 67 | // Use the indexes within the loop 68 | 69 | $posts = ['Post One', 'Post Two', 'Post Three']; 70 | 71 | foreach ($posts as $index => $post) { 72 | echo "${index} - ${post}
"; 73 | } 74 | 75 | // Use the keys within the loop for an associative array 76 | 77 | $person = [ 78 | 'first_name' => 'Brad', 79 | 'last_name' => 'Traversy', 80 | 'email' => 'brad@gmail.com', 81 | ]; 82 | 83 | // Get Keys 84 | foreach ($person as $key => $val) { 85 | echo "${key} - ${val}
"; 86 | } 87 | -------------------------------------------------------------------------------- /06_functions.php: -------------------------------------------------------------------------------- 1 | $num1 * $num2; 56 | 57 | echo $multiply(5, 5); 58 | -------------------------------------------------------------------------------- /07_array_functions.php: -------------------------------------------------------------------------------- 1 | $number < 10); 62 | 63 | // Array Reduce 64 | // "carry" holds the return value of the previous iteration 65 | $sum = array_reduce($numbers, fn($carry, $number) => $carry + $number); 66 | var_dump($sum); 67 | -------------------------------------------------------------------------------- /08_string_functions.php: -------------------------------------------------------------------------------- 1 | Hello World'; 51 | echo htmlentities($string2); 52 | 53 | // Formatted Strings - useful when you have outside data 54 | // Different specifiers for different data types 55 | printf('%s is a %s', 'Brad', 'nice guy'); 56 | printf('1 + 1 = %f', 1 + 1); // float 57 | -------------------------------------------------------------------------------- /09_superglobals.php: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Document 28 | 29 | 30 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /10_get_post.php: -------------------------------------------------------------------------------- 1 | ' . $GET['username'] . ''; 10 | echo '

' . $_POST['username'] . '

'; 11 | } ?> 12 | 13 | 14 | Link 15 | 16 | 17 |

18 | 19 | 20 |
21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 |
-------------------------------------------------------------------------------- /11_sanitizing_inputs.php: -------------------------------------------------------------------------------- 1 | 31 | 32 | 33 | 34 |
37 |
38 | 39 | 40 |
41 |
42 | 43 |
44 | 45 | 46 |
47 |
48 | 49 |
-------------------------------------------------------------------------------- /12_cookies.php: -------------------------------------------------------------------------------- 1 | 33 | 34 |
37 |
38 | 39 | 40 |
41 |
42 |
43 | 44 | 45 |
46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /14_file_handling.php: -------------------------------------------------------------------------------- 1 | File uploaded!

'; 28 | } else { 29 | echo '

File too large!

'; 30 | } 31 | } else { 32 | $message = '

Invalid file type!

'; 33 | } 34 | } else { 35 | $message = '

Please choose a file

'; 36 | } 37 | } 38 | ?> 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | File Upload 47 | 48 | 49 | 50 |
53 | Select image to upload: 54 | 55 | 56 |
57 | 58 | -------------------------------------------------------------------------------- /16_exceptions.php: -------------------------------------------------------------------------------- 1 | getMessage(), ' '; 24 | // } 25 | 26 | // Finally block is executed regardless of whether an exception is thrown or not 27 | 28 | try { 29 | echo inverse(5) . ' '; 30 | } catch (Exception $e) { 31 | echo 'Caught exception: ', $e->getMessage(), ' '; 32 | } finally { 33 | echo 'First finally '; 34 | } 35 | 36 | try { 37 | echo inverse(0) . ' '; 38 | } catch (Exception $e) { 39 | echo 'Caught exception: ', $e->getMessage(), ' '; 40 | } finally { 41 | echo "Second finally "; 42 | } 43 | 44 | 45 | echo 'Hello World'; -------------------------------------------------------------------------------- /17_oop.php: -------------------------------------------------------------------------------- 1 | name = $name; 23 | $this->email = $email; 24 | $this->password = $password; 25 | } 26 | 27 | // Methods are functions that belong to a class. 28 | // function setName() { 29 | // $this->name = $name; 30 | // } 31 | 32 | function getName() { 33 | return $this->name; 34 | } 35 | 36 | function login() { 37 | return "User $this->name is logged in."; 38 | } 39 | 40 | // Destructor is called when an object is destroyed or the end of the script. 41 | function __destruct() { 42 | echo "The user name is {$this->name}."; 43 | } 44 | } 45 | 46 | // Instantiate a new user 47 | $user1 = new User('Brad', 'brad@gmail.com', '123456'); 48 | echo $user1->getName(); 49 | echo $user1->login(); 50 | 51 | // Add a value to a property 52 | // $user1->name = 'Brad'; 53 | 54 | var_dump($user1); 55 | // echo $user1->name; 56 | 57 | /* ----------- Inheritence ---------- */ 58 | 59 | /* 60 | Inheritence is the ability to create a new class from an existing class. 61 | It is achieved by creating a new class that extends an existing class. 62 | */ 63 | 64 | class employee extends User { 65 | public function __construct($name, $email, $password, $title) { 66 | parent::__construct($name, $email, $password); 67 | $this->title = $title; 68 | } 69 | 70 | public function getTitle() { 71 | return $this->title; 72 | } 73 | } 74 | 75 | $employee1 = new employee('John','johndoe@gmail.com','123456','Manager'); 76 | echo $employee1->getTitle(); -------------------------------------------------------------------------------- /_starter_files/01_output.php: -------------------------------------------------------------------------------- 1 | Greater than 10 | <= Less than or equal to 11 | >= Greater than or equal to 12 | == Equal to 13 | === Identical to 14 | != Not equal to 15 | !== Not identical to 16 | */ 17 | 18 | /* ---------- If & If-Else Statements --------- */ 19 | 20 | /* 21 | ** If Statement Syntax 22 | if (condition) { 23 | // code to be executed if condition is true 24 | } 25 | */ 26 | 27 | /* -------- Ternary Operator -------- */ 28 | /* 29 | The ternary operator is a shorthand if statement. 30 | Ternary Syntax: 31 | condition ? true : false; 32 | */ 33 | 34 | 35 | /* -------- Switch Statements ------- */ 36 | -------------------------------------------------------------------------------- /_starter_files/05_loops.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Leave Feedback 9 | 10 | 11 | 32 | 33 |
34 |
35 |

About

36 | 37 |

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Inventore impedit totam porro iure reiciendis autem possimus sapiente, optio, exercitationem ipsum assumenda mollitia, recusandae expedita culpa ratione voluptatem esse quos quam?

38 |
39 |
40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /_starter_files/feedback/feedback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Leave Feedback 9 | 10 | 11 | 32 | 33 |
34 |
35 | 36 |

Feedback

37 | 38 |
39 |
40 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta molestias animi earum eos dolorem repellat a quibusdam, aperiam vero repellendus voluptatibus natus deserunt sed doloribus inventore, totam labore maxime perferendis! 41 |
42 |
43 | 44 |
45 |
46 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta molestias animi earum eos dolorem repellat a quibusdam, aperiam vero repellendus voluptatibus natus deserunt sed doloribus inventore, totam labore maxime perferendis! 47 |
48 |
49 | 50 |
51 |
52 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta molestias animi earum eos dolorem repellat a quibusdam, aperiam vero repellendus voluptatibus natus deserunt sed doloribus inventore, totam labore maxime perferendis! 53 |
54 |
55 |
56 |
57 | 58 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /_starter_files/feedback/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/php-crash/1aff0021d3e34ecea81d52157a2cb6b9b38394db/_starter_files/feedback/img/logo.png -------------------------------------------------------------------------------- /_starter_files/feedback/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Leave Feedback 9 | 10 | 11 | 36 | 37 |
38 |
39 | 40 |

Feedback

41 |

Leave feedback for Traversy Media

42 |
43 |
44 | 45 | 46 |
47 |
48 | 49 | 50 |
51 |
52 | 53 | 54 |
55 |
56 | 57 |
58 |
59 |
60 |
61 | 62 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /_starter_files/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-crash", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/bradtraversy/php-crash.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/bradtraversy/php-crash/issues" 17 | }, 18 | "homepage": "https://github.com/bradtraversy/php-crash#readme", 19 | "devDependencies": { 20 | "@prettier/plugin-php": "^0.18.3", 21 | "prettier": "^2.6.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /extras/dashboard.php: -------------------------------------------------------------------------------- 1 | Welcome, ' . $_SESSION['username'] . ''; 6 | echo 'Logout'; 7 | } else { 8 | echo '

Welcome, Guest

'; 9 | echo 'Home'; 10 | } 11 | -------------------------------------------------------------------------------- /extras/logout.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

About

4 | 5 |

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Inventore impedit totam porro iure reiciendis autem possimus sapiente, optio, exercitationem ipsum assumenda mollitia, recusandae expedita culpa ratione voluptatem esse quos quam?

6 | 7 | -------------------------------------------------------------------------------- /feedback/config/database.php: -------------------------------------------------------------------------------- 1 | connect_error) { 12 | die('Connection failed: ' . $conn->connect_error); 13 | } 14 | 15 | // echo 'Connected successfully'; 16 | -------------------------------------------------------------------------------- /feedback/feedback.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 |

Past Feedback

11 | 12 | 13 |

There is no feedback

14 | 15 | 16 | 17 |
18 |
19 | 20 |
By on
26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /feedback/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/php-crash/1aff0021d3e34ecea81d52157a2cb6b9b38394db/feedback/img/logo.png -------------------------------------------------------------------------------- /feedback/inc/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /feedback/inc/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Leave Feedback 10 | 11 | 12 | 33 | 34 |
35 |
-------------------------------------------------------------------------------- /feedback/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 55 | 56 | 57 |

Feedback

58 | 59 |

Leave feedback for Traversy Media

60 | 61 |
64 |
65 | 66 | 68 |
69 | Please provide a valid name. 70 |
71 |
72 |
73 | 74 | 76 |
77 |
78 | 79 | 81 |
82 |
83 | 84 |
85 |
86 | 87 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-crash", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "version": "1.0.0", 9 | "license": "ISC", 10 | "devDependencies": { 11 | "@prettier/plugin-php": "^0.18.3", 12 | "prettier": "^2.6.0" 13 | } 14 | }, 15 | "node_modules/@prettier/plugin-php": { 16 | "version": "0.18.3", 17 | "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.18.3.tgz", 18 | "integrity": "sha512-8jJ88iNVu3xC4DgA6f4eGk1yWQSno3Kd7XpUysokC8q0GXIr07zk7qdsfH+UooCf91sB0m2fZ2fdDmDMPOHhMA==", 19 | "dev": true, 20 | "dependencies": { 21 | "linguist-languages": "^7.5.1", 22 | "mem": "^8.0.0", 23 | "php-parser": "3.1.0-beta.5" 24 | }, 25 | "peerDependencies": { 26 | "prettier": "^1.15.0 || ^2.0.0" 27 | } 28 | }, 29 | "node_modules/linguist-languages": { 30 | "version": "7.15.0", 31 | "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.15.0.tgz", 32 | "integrity": "sha512-qkSSNDjDDycZ2Wcw+GziNBB3nNo3ddYUInM/PL8Amgwbd9RQ/BKGj2/1d6mdxKgBFnUqZuaDbkIwkE4KUwwmtQ==", 33 | "dev": true 34 | }, 35 | "node_modules/map-age-cleaner": { 36 | "version": "0.1.3", 37 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 38 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 39 | "dev": true, 40 | "dependencies": { 41 | "p-defer": "^1.0.0" 42 | }, 43 | "engines": { 44 | "node": ">=6" 45 | } 46 | }, 47 | "node_modules/mem": { 48 | "version": "8.1.1", 49 | "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", 50 | "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", 51 | "dev": true, 52 | "dependencies": { 53 | "map-age-cleaner": "^0.1.3", 54 | "mimic-fn": "^3.1.0" 55 | }, 56 | "engines": { 57 | "node": ">=10" 58 | }, 59 | "funding": { 60 | "url": "https://github.com/sindresorhus/mem?sponsor=1" 61 | } 62 | }, 63 | "node_modules/mimic-fn": { 64 | "version": "3.1.0", 65 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", 66 | "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", 67 | "dev": true, 68 | "engines": { 69 | "node": ">=8" 70 | } 71 | }, 72 | "node_modules/p-defer": { 73 | "version": "1.0.0", 74 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 75 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", 76 | "dev": true, 77 | "engines": { 78 | "node": ">=4" 79 | } 80 | }, 81 | "node_modules/php-parser": { 82 | "version": "3.1.0-beta.5", 83 | "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.1.0-beta.5.tgz", 84 | "integrity": "sha512-3F3+yThjD7wn0sMuIG5iMQqutmH+RJUAbEyPW5S/greTp5ZArkpEweylQh+do22q9UJlJT1PrLN/AwnzDUti6Q==", 85 | "dev": true 86 | }, 87 | "node_modules/prettier": { 88 | "version": "2.6.0", 89 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", 90 | "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", 91 | "dev": true, 92 | "bin": { 93 | "prettier": "bin-prettier.js" 94 | }, 95 | "engines": { 96 | "node": ">=10.13.0" 97 | }, 98 | "funding": { 99 | "url": "https://github.com/prettier/prettier?sponsor=1" 100 | } 101 | } 102 | }, 103 | "dependencies": { 104 | "@prettier/plugin-php": { 105 | "version": "0.18.3", 106 | "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.18.3.tgz", 107 | "integrity": "sha512-8jJ88iNVu3xC4DgA6f4eGk1yWQSno3Kd7XpUysokC8q0GXIr07zk7qdsfH+UooCf91sB0m2fZ2fdDmDMPOHhMA==", 108 | "dev": true, 109 | "requires": { 110 | "linguist-languages": "^7.5.1", 111 | "mem": "^8.0.0", 112 | "php-parser": "3.1.0-beta.5" 113 | } 114 | }, 115 | "linguist-languages": { 116 | "version": "7.15.0", 117 | "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.15.0.tgz", 118 | "integrity": "sha512-qkSSNDjDDycZ2Wcw+GziNBB3nNo3ddYUInM/PL8Amgwbd9RQ/BKGj2/1d6mdxKgBFnUqZuaDbkIwkE4KUwwmtQ==", 119 | "dev": true 120 | }, 121 | "map-age-cleaner": { 122 | "version": "0.1.3", 123 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 124 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 125 | "dev": true, 126 | "requires": { 127 | "p-defer": "^1.0.0" 128 | } 129 | }, 130 | "mem": { 131 | "version": "8.1.1", 132 | "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", 133 | "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", 134 | "dev": true, 135 | "requires": { 136 | "map-age-cleaner": "^0.1.3", 137 | "mimic-fn": "^3.1.0" 138 | } 139 | }, 140 | "mimic-fn": { 141 | "version": "3.1.0", 142 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", 143 | "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", 144 | "dev": true 145 | }, 146 | "p-defer": { 147 | "version": "1.0.0", 148 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 149 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", 150 | "dev": true 151 | }, 152 | "php-parser": { 153 | "version": "3.1.0-beta.5", 154 | "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.1.0-beta.5.tgz", 155 | "integrity": "sha512-3F3+yThjD7wn0sMuIG5iMQqutmH+RJUAbEyPW5S/greTp5ZArkpEweylQh+do22q9UJlJT1PrLN/AwnzDUti6Q==", 156 | "dev": true 157 | }, 158 | "prettier": { 159 | "version": "2.6.0", 160 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", 161 | "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", 162 | "dev": true 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-crash", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/bradtraversy/php-crash.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/bradtraversy/php-crash/issues" 17 | }, 18 | "homepage": "https://github.com/bradtraversy/php-crash#readme", 19 | "devDependencies": { 20 | "@prettier/plugin-php": "^0.18.3", 21 | "prettier": "^2.6.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # PHP Crash Course Files 2 | 3 | These are the files from my crash course on Youtube. If you want to follow along and use the files, you can clone or download the zip and use the **_starter_files** folder. 4 | 5 | If you are using VS Code and prettier and want Prettier to work with .php files, run 6 | 7 | ``` 8 | npm install 9 | ``` -------------------------------------------------------------------------------- /uploads/Abstract-PNG-Images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bradtraversy/php-crash/1aff0021d3e34ecea81d52157a2cb6b9b38394db/uploads/Abstract-PNG-Images.png --------------------------------------------------------------------------------