"Connie Wang", "AB" => "Jack Venberg", "AC" => "William Kim", "AD" => "Kelley Chen", "AE" => "Sweekruthi Raghunathan", "AF" => "Jeffrey Worley", "AI" => "Sven Hansen", "AJ" => "Anupam Gupta", "AK" => "Conner Ardman", "AL" => "Andrew Wolfram"); # Part 1: Finish this web service to take a GET parameter called 'section' # and print out the TA name for that section. if (isset($_GET["section"])) { $section = strtoupper($_GET["section"]); if ($tas[$section]) { echo $tas[$section]; } else { echo "Passed section code not found."; } } else if (isset($_GET["name"])) { # Part 2: Finish this web service to take a GET parameter called 'name' # and print out the section for the TA with the value passed as their first name. $name = $_GET["name"]; foreach ($tas as $key => $value) { # explode is a function which "explodes" a string based on a delimiter, returning an array of the pieces $firstname = explode(" ", $value)[0]; if (strtolower($name) === strtolower($firstname)) { echo "$key\n"; # we found a TA with the first name! Print their section code. } } } else { echo "Missing one of required 'section' or 'name' GET parameters."; } ?>