Color theme
0 day streak0 XPP1
PHPLearn mode
MISSION 1 OF 1

Format a help-desk reference

0 XP earned
PHP track: IntermediateMission: BeginnerTyped functionsString concatenationString methods
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.

x
0 / 2 challenges
LEARN THE CONCEPT

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.

quest.php
<?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.