Skip to content

Instantly share code, notes, and snippets.

@recck
recck / loops.php
Created August 27, 2012 19:56
Week 2 - Day 4 - PHP Loops
<?php
/**
* for loops
* where to start; when to continue; how to step through
**/
for($i = 0; $i < 10; $i++){
// start at i = 0 and continue until i is >= 10
echo $i;
@recck
recck / logic.php
Created August 22, 2012 21:00
Week 2 - Day 3 - Conditional Logic
<?php
/**
* Mathematical Comparison Operators
* x > y, is x greater than y?
* x >= y, is x greater than OR equal to y?
* x < y, is x less than y?
* x <= y, is x less than OR equal to y?
*
* Logical Comparison Operators
* x == y, does x have the same value as y?
@recck
recck / lec02.php
Created August 22, 2012 01:58
Week 1 - Day 2 - PHP Syntax, Variables and Mathematical Operations
<?php
/**
* Mathematical Operations
* Addition, +, 5+2 = 7
* Subtraction, -, 5-2 = 3
* Multiplication, *, 5*2 = 10
* Division, /, 5/2 = 2.5
* Modulus, %, 5%2 = 1
*
* Short Hand Operations