| "; echo $i . " " . $j . " | "; } echo "
4x4 Checkerboard
"; 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 . "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 . "Lunch