HTTP atbildes sākuma rindas nodošana PHP

Izmantojot funkciju header var arī nodot HTTP atbildes sākuma rindu. Parasti to izmanto, lai norādītu statusu. Galvenokārt 404 kļūdai:

php<?php
  header('HTTP/1.1 404 Not Found');
?>
Задание 1

Pabeidziet kodu tā, lai tiktu nodots 404 kļūdas galvene:

php<?php
  $arr = ['a', 'b', 'c'];
  $key = $_GET['key'];
  
  if (isset($arr[$key])) {
    echo $arr[$key];
  } else {
    // nodot 404
    echo 'error';
  }
?>