If i was to have an array of error codes I.E. $error_code =[400=> "Bad request", 404 => "Not found"];
.
How would i create a function that accepts 2 input parameters error_code
& error_message
. And prints out a header that has the form: Protocol Code - Reason(custom message dependant on what went wrong)
.
I.E. "error": 400 - Bad Request: Name contains whitespaces