";
echo str_replace("Jo", "Mo", $workers[0]) . "
";
echo substr($workers[0], 1, 1) . "
";
}
$staff = array("John", "Bob");
doStuff($staff);
foreach ($workers as $person) {
echo $person . ", ";
}
?>
";
$num = 0;
echo $num++;
echo $num;
$num = 0;
echo ++$num;
?>
Calculator
31, "Alex" => 20);
echo $ages["John"] . $ages["Alex"];
?>
name = $personName;
$this->setAge($personAge);
}
function setAge($age) {
if ($age < 0 || $age > 200) {
throw new Exception("Invalid age!", 1);
}
$this->age = $age;
}
function getAge() {
return $this->age;
}
}
class Worker extends Person {
}
$max = new Worker("Alex", 34);
//$max->name = "Max";
//$max->age = 22;
echo $max->name, $max->getAge();
?>