title: Implement a PHP function that returns a HTTP status code
body: <p>I have this question for homework and i was if i am on the right track?</p>
  
  <p>Implement   a   PHP function    that    returns a   HTTP    status  code    along   with    a   custom  message in<br>
  the header  and body    of  the response    to  the client. This    function    will    be  needed  for all 
  subsequent  sections,   and should  be  used    when    an  error   occurs  (invalid    input,  wrong   request 
  type    etc.).</p>
  
  <p>The function    must    set the appropriate HTTP    header  AND provide the message in  the 
  response    body    in  JSON    format.</p>
  
  <p>So far i have:</p>
  
  <pre><code>    function send_error($code, $message){
          echo: "Error:" 
      }
  </code></pre>