Returning HTTP Response Status in PHP

You can set the HTTP response status separately, without specifying the start line. This is done using the function http_response_code:

php<?php
  http_response_code(404);
?>
Задание 1

Complete the code so that it returns the corresponding HTTP statuses:

php<?php
  $arr = ['a', 'b', 'c'];
  
  if (isset($_GET['key'])) {
    $key = $_GET['key'];
    
    if (isset($arr[$key])) {
      echo $arr[$key];
    } else {
      // return 404
      echo 'Not Found';
    }
  } else {
    // return 403
    echo 'Forbidden';
  }
?>