Forgets

Seriously, PHP does not forget it’s code but in fact I do keep forgetting how to do some of the simple things in PHP due to my medication, so here is my forgetful list of PHP code snippets that I refer back to.

For with Step value

For statement with a step value increment. In this snippet we will step in increments of 10 starting at 0 and finishing at 100.


for ( $i=0; $i<=100; $i +=10 ) {
// Do work here
}

If And If Statement

If statement and an additional If statement.


if ($q1 == "false" && $q2 == "true") {
// Do work here
}

If Or If Statement

If statement and an additional If statement.


if ($q1 == "false" || $q2 == "true") {
// Do work here
}

Comments are closed.