Workshop

The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.

Quiz

1:True or false: If a function doesn't require an argument, you can omit the parentheses in the function call.
2:How do you return a value from a function?
3:What would the following code fragment print to the browser?
$number = 50;

function tenTimes() {
    $number = $number * 10;
}

tenTimes();
echo $number;
4:What would the following code fragment print to the browser?
$number = 50;

function tenTimes() {
    global $number;
    $number = $number * 10;
}

tenTimes();
echo $number;
5:What would the following code fragment print to the browser?
 $number = 50; function tenTimes( &$n ) { $n = $n * 10; } ...

Get Sams Teach Yourself PHP, MySQL® and Apache All in One now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.