Complete the code to get the value of the URL parameter named 'name'.
<?php $name = $_GET[[1]]; echo "Hello, $name!"; ?>
URL parameters are accessed as strings inside $_GET, so the key must be quoted.
Complete the code to check if the URL parameter 'age' is set.
<?php if (isset($_GET[[1]])) { echo "Age is set."; } else { echo "Age is not set."; } ?>
Use quotes around the parameter name when checking with isset().
Fix the error in the code to safely get the 'city' parameter or use 'Unknown' if not set.
<?php $city = $_GET[[1]] ?? 'Unknown'; echo "City: $city"; ?>
The key must be a quoted string to access the $_GET array correctly.
Fill both blanks to create an associative array with key as parameter name and value from $_GET for 'user'.
<?php $data = [[1] => $_GET[[2]]]; print_r($data); ?>
Both the array key and the $_GET key must be quoted strings matching the parameter name.
Fill all three blanks to loop through $_GET and print each parameter and its value.
<?php foreach ($_GET as [1] => [2]) { echo [3] . ': ' . [2] . "<br>"; } ?>
Use $key and $value as variable names in the foreach loop. The first blank is the key, the second is the value, and the third blank is the key used in echo.