Send HTTP 418 I'm a kettle

I have a web server, and I would like to have the HTTP status code 418 "I’m a teapot" in some conditions, I’m sure that I will use the if statement, I just can’t get it on a trip, any help?

+5
source share
1 answer
<?php
header("HTTP/1.1 418 I'm a teapot");
?>
<html>
<h1>418 I'm a teapot</h1><br>
<p>The HTCPCP Server is a teapot. The responding entity MAY be short and stout.</p>
</html>

will result in:

418 I am a teapot


The HTCPCP server is a kettle. The responder MAY be short and fat.

+27
source