Colors

"; echo ""; for ($j=0; $j<2; $j++){ echo ""; for($i=0; $i<12; $i++){ echo ""; } echo ""; } echo "
"; echo $i . " " . $j . "
"; echo "

4x4 Checkerboard

"; echo ""; for ($i=0; $i<4; $i++){ echo ""; for ($j=0; $j<4; $j++){ echo ""; } echo ""; } echo "
"; echo "

Birthdays

"; $bd = array("Alex"=>"07/31", "Daniel"=>"20/12", "Slava"=>"14/11"); foreach($bd as $name=>$birthday) echo "

{$name}'s birthday is {$birthday}

"; echo "

MyClass

"; // figure 6-2 from "Introduction to PHP" by L. Atkinson include "userclass.php"; $currentuser = new user; $currentuser->init( "Alex","07/31" ); echo "name = " . $currentuser->name . "
"; echo "birthday = " . $currentuser->birthday . "
"; echo "

MyClass with array

"; $users = array(); $i=0; foreach($bd as $name=>$birthday){ $users[$i] = new user; $users[$i]->init($name,$birthday); $i++; } foreach($users as $user){ echo "name = " . $user->name . "
"; echo "birthday = " . $user->birthday . "
"; } ?>

Lunch

your name:
cost of lunch: 5.00 8.00 9.75 11.95 15.00
days buying lunch: