Format a help-desk reference
Before you start this intermediate track
Variables, function calls, and key-value arrays. These examples run as small scripts.
Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.
Understand it, then try it.
A help desk builds a reference from a team label and a ticket number. A function names this reusable operation and declares its input and return types. strtoupper formats the label, while PHP uses the dot operator to concatenate text. Joining an integer into the string produces its textual representation.
<?phpfunction reference(string $team, int $ticket): string { return strtoupper($team) . "-" . $ticket;}echo reference("lab", 17), "\n";Each mission is a complete independent PHP 8 or later command-line script, including the opening <?php tag. Save as quest.php and run php quest.php. Output is plain text; no web server is required.
Track the values line by line. Predict the result before running this example in your own editor.