This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class DoMath { | |
| public $var; | |
| public static $boo; | |
| public function addToVar($value) { | |
| // $this->var += $value; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ... | |
| } elseif ($input == 'R') { | |
| // Remove which item? | |
| echo 'Enter item number to remove: '; | |
| // Get array key | |
| $key = trim(fgets(STDIN)); | |
| while ($key < count($items)) { | |
| $items[$key - 1] = $items[$key]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /******************************* | |
| * Setup Connection | |
| *******************************/ | |
| $dbc = new PDO('mysql:host=127.0.0.1;dbname=codeup_demo_db', 'username', 'password'); | |
| // Tell PDO to throw exceptions on error | |
| $dbc->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE user_role ( | |
| user_id INT(10) UNSIGNED NOT NULL, | |
| role_id INT(10) UNSIGNED NOT NULL, | |
| PRIMARY KEY (user_id, role_id), | |
| CONSTRAINT user_role_role_fk FOREIGN KEY (role_id) REFERENCES role (id) | |
| ON DELETE CASCADE ON UPDATE CASCADE, | |
| CONSTRAINT user_role_user_fk FOREIGN KEY (user_id) REFERENCES `user` (id) | |
| ON DELETE CASCADE ON UPDATE CASCADE | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| ############################# | |
| # Codeup Server Setup | |
| ############################# | |
| box = 'chef/ubuntu-14.04' | |
| hostname = 'codeup-trusty' | |
| domain = 'codeup.dev' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $students = array( | |
| 'Andrew', | |
| 'Caitlin', | |
| 'Josue', | |
| 'Genaro', | |
| 'Amanda', | |
| 'Ashley F', | |
| 'Michael', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /************************************ | |
| * NOTE!!!! | |
| * This file is meant as notes / examples. | |
| * The code, as it's current written, will not work | |
| * and will probably output some errors/notices. | |
| * Use this file as examples, not as code that's meant to be run. | |
| ************************************ | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $items = [ | |
| 0 => 'first', | |
| 1 => 'second', | |
| 2 => 'third' | |
| ]; | |
| // A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Stop Watch</title> | |
| </head> | |
| <body> | |
| <h1>Stop Watch</h1> | |
| <button id="startButton">Start</button> | |
| <button id="stopButton">Stop</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php foreach: ($parks as $parkInfo): ?> | |
| <!-- ... --> | |
| <td> | |
| <!-- This is the button the user will click to remove an item --> | |
| <button class="btn btn-danger btn-xs btn-delete" data-id="<?= $parkInfo['id']; ?>" data-name="<?= $parkInfo['name']; ?>"> | |
| Delete | |
| </button> | |
| </td> | |
OlderNewer